@Mojo(name="deploy-file",
requiresProject=false,
threadSafe=true)
public class DeployFileMojo
extends AbstractDeployMojo
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
artifactId
ArtifactId of the artifact to be deployed.
|
private java.lang.String |
classifier
Add classifier to the artifact
|
private java.lang.String |
classifiers
A comma separated list of classifiers for each of the extra side artifacts to deploy.
|
private java.lang.String |
description
Description passed to a generated POM file (in case of generatePom=true)
|
private java.io.File |
file
File to be deployed.
|
private java.lang.String |
files
A comma separated list of files for each of the extra side artifacts to deploy.
|
private boolean |
generatePom
Upload a POM for this artifact.
|
private java.lang.String |
groupId
GroupId of the artifact to be deployed.
|
private java.io.File |
javadoc
The bundled API docs for the artifact.
|
private org.apache.maven.project.validation.ModelValidator |
modelValidator
The component used to validate the user-supplied artifact coordinates.
|
private java.lang.String |
packaging
Type of the artifact to be deployed.
|
private java.io.File |
pomFile
Location of an existing POM file to be deployed alongside the main artifact, given by the ${file} parameter.
|
private org.apache.maven.project.MavenProject |
project
The default Maven project created when building the plugin
|
private org.apache.maven.project.MavenProjectHelper |
projectHelper
Used for attaching the source and javadoc jars to the project.
|
private java.lang.String |
repositoryId
Server Id to map on the <id> under <server> section of settings.xml In most cases, this parameter
will be required for authentication.
|
private java.lang.String |
repositoryLayout
The type of remote repository layout to deploy to.
|
private java.io.File |
sources
The bundled sources for the artifact.
|
private java.lang.String |
types
A comma separated list of types for each of the extra side artifacts to deploy.
|
private boolean |
uniqueVersion
Whether to deploy snapshots with a unique version or not.
|
private java.lang.String |
url
URL where the artifact will be deployed.
|
private java.lang.String |
version
Version of the artifact to be deployed.
|
artifactFactory, repositoryFactory, updateReleaseInfo| Constructor and Description |
|---|
DeployFileMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute() |
private org.apache.maven.model.Model |
generateModel()
Generates a minimal model from the user-supplied artifact information.
|
private java.io.File |
generatePomFile()
Generates a minimal POM from the user-supplied artifact information.
|
(package private) java.lang.String |
getArtifactId() |
(package private) java.lang.String |
getClassifier() |
(package private) java.io.File |
getFile() |
(package private) java.lang.String |
getGroupId() |
private java.io.File |
getLocalRepoFile(org.apache.maven.artifact.Artifact artifact)
Gets the path of the specified artifact within the local repository.
|
(package private) java.lang.String |
getPackaging() |
(package private) java.lang.String |
getVersion() |
(package private) void |
initProperties() |
private void |
processModel(org.apache.maven.model.Model model)
Process the supplied pomFile to get groupId, artifactId, version, and packaging
|
(package private) org.apache.maven.model.Model |
readModel(java.io.File pomFile)
Extract the model from the specified POM file.
|
(package private) void |
setArtifactId(java.lang.String artifactId) |
(package private) void |
setClassifier(java.lang.String classifier) |
(package private) void |
setGroupId(java.lang.String groupId) |
(package private) void |
setPackaging(java.lang.String packaging) |
(package private) void |
setPomFile(java.io.File pomFile) |
(package private) void |
setVersion(java.lang.String version) |
private void |
validateArtifactInformation()
Validates the user-supplied artifact information.
|
deploy, failIfOffline, getDeployer, getLayout, getLocalRepository, getRetryFailedDeploymentCount, isUpdateReleaseInfo, setDeployer, setLocalRepository@Parameter(defaultValue="${project}",
readonly=true,
required=true)
private org.apache.maven.project.MavenProject project
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
@Parameter(property="groupId") private java.lang.String groupId
@Parameter(property="artifactId") private java.lang.String artifactId
@Parameter(property="version") private java.lang.String version
@Parameter(property="packaging") private java.lang.String packaging
@Parameter(property="generatePom.description") private java.lang.String description
@Parameter(property="file",
required=true)
private java.io.File file
@Parameter(property="javadoc") private java.io.File javadoc
@Parameter(property="sources") private java.io.File sources
@Parameter(property="repositoryId",
defaultValue="remote-repository",
required=true)
private java.lang.String repositoryId
@Parameter(property="repositoryLayout",
defaultValue="default")
private java.lang.String repositoryLayout
@Parameter(property="url",
required=true)
private java.lang.String url
@Parameter(property="pomFile") private java.io.File pomFile
@Parameter(property="generatePom",
defaultValue="true")
private boolean generatePom
@Parameter(property="classifier") private java.lang.String classifier
@Parameter(property="uniqueVersion",
defaultValue="true")
private boolean uniqueVersion
@Component private org.apache.maven.project.validation.ModelValidator modelValidator
@Parameter(property="types") private java.lang.String types
files or classifiers, then an error will be raised.@Parameter(property="classifiers") private java.lang.String classifiers
@Parameter(property="files") private java.lang.String files
types or classifiers, then an error will be raised.void initProperties()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprivate java.io.File getLocalRepoFile(org.apache.maven.artifact.Artifact artifact)
artifact - The artifact whose local repo path should be determined, must not be null.null.private void processModel(org.apache.maven.model.Model model)
model - The POM to extract missing artifact coordinates from, must not be null.org.apache.maven.model.Model readModel(java.io.File pomFile)
throws org.apache.maven.plugin.MojoExecutionException
pomFile - The path of the POM file to parse, must not be null.null.org.apache.maven.plugin.MojoExecutionException - If the file doesn't exist of cannot be read.private java.io.File generatePomFile()
throws org.apache.maven.plugin.MojoExecutionException
null.org.apache.maven.plugin.MojoExecutionException - If the generation failed.private void validateArtifactInformation()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - If any artifact coordinate is invalid.private org.apache.maven.model.Model generateModel()
null.void setGroupId(java.lang.String groupId)
void setArtifactId(java.lang.String artifactId)
void setVersion(java.lang.String version)
void setPackaging(java.lang.String packaging)
void setPomFile(java.io.File pomFile)
java.lang.String getGroupId()
java.lang.String getArtifactId()
java.lang.String getVersion()
java.lang.String getPackaging()
java.io.File getFile()
java.lang.String getClassifier()
void setClassifier(java.lang.String classifier)