Package org.codehaus.mojo.buildhelper
Class AttachArtifactMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.buildhelper.AttachArtifactMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="attach-artifact", defaultPhase=PACKAGE, threadSafe=true) public class AttachArtifactMojo extends org.apache.maven.plugin.AbstractMojoAttach additional artifacts to be installed and deployed.- Since:
- 1.0
- Version:
- $Id: AttachArtifactMojo.java 17587 2012-09-22 20:42:37Z hboutemy $
-
-
Field Summary
Fields Modifier and Type Field Description private Artifact[]artifactsAttach an array of artifacts to the project.private java.lang.StringbasedirThis project's base directory.private org.apache.maven.execution.MavenSessionmavenSessionThe Maven Session.private org.apache.maven.project.MavenProjectprojectprivate org.apache.maven.project.MavenProjectHelperprojectHelperMaven ProjectHelper.private booleanrunOnlyAtExecutionRootThis will cause the execution to be run only at the top of a given module tree.private booleanskipAttachThis allows to skip the attach execution in case it is known that the corresponding file does not exists.
-
Constructor Summary
Constructors Constructor Description AttachArtifactMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()private booleanisThisTheExecutionRoot()Returnstrueif the current project is located at the Execution Root Directory (where mvn was launched).private voidvalidateArtifacts()
-
-
-
Field Detail
-
artifacts
@Parameter(required=true) private Artifact[] artifacts
Attach an array of artifacts to the project.
-
basedir
@Parameter(defaultValue="${basedir}") private java.lang.String basedirThis project's base directory.- Since:
- 1.5
-
mavenSession
@Component private org.apache.maven.execution.MavenSession mavenSession
The Maven Session.- Since:
- 1.5
-
project
@Component private org.apache.maven.project.MavenProject project
-
projectHelper
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
Maven ProjectHelper.
-
runOnlyAtExecutionRoot
@Parameter(property="buildhelper.runOnlyAtExecutionRoot", defaultValue="false") private boolean runOnlyAtExecutionRootThis will cause the execution to be run only at the top of a given module tree. That is, run in the project contained in the same folder where the mvn execution was launched.- Since:
- 1.5
-
skipAttach
@Parameter(property="buildhelper.skipAttach", defaultValue="false") private boolean skipAttachThis allows to skip the attach execution in case it is known that the corresponding file does not exists. For exemple, when the previous ant-run task is skipped with a unless.- Since:
- 1.6
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
isThisTheExecutionRoot
private boolean isThisTheExecutionRoot()
Returnstrueif the current project is located at the Execution Root Directory (where mvn was launched).- Returns:
trueif the current project is at the Execution Root
-
validateArtifacts
private void validateArtifacts() throws org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoFailureException
-
-