@Mojo(name="attach-artifact",
defaultPhase=PACKAGE,
threadSafe=true)
public class AttachArtifactMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
private Artifact[] |
artifacts
Attach an array of artifacts to the project.
|
private java.lang.String |
basedir
This project's base directory.
|
private org.apache.maven.execution.MavenSession |
mavenSession
The Maven Session.
|
private org.apache.maven.project.MavenProject |
project |
private org.apache.maven.project.MavenProjectHelper |
projectHelper
Maven ProjectHelper.
|
private boolean |
runOnlyAtExecutionRoot
This will cause the execution to be run only at the top of a given module
tree.
|
private boolean |
skipAttach
This allows to skip the attach execution in case it is known that the corresponding file does not exists.
|
Constructor and Description |
---|
AttachArtifactMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
private boolean |
isThisTheExecutionRoot()
Returns
true if the current project is located at the
Execution Root Directory (where mvn was launched). |
private void |
validateArtifacts() |
@Parameter(required=true) private Artifact[] artifacts
@Parameter(defaultValue="${basedir}") private java.lang.String basedir
@Component private org.apache.maven.execution.MavenSession mavenSession
@Component private org.apache.maven.project.MavenProject project
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
@Parameter(property="buildhelper.runOnlyAtExecutionRoot", defaultValue="false") private boolean runOnlyAtExecutionRoot
@Parameter(property="buildhelper.skipAttach", defaultValue="false") private boolean skipAttach
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
private boolean isThisTheExecutionRoot()
true
if the current project is located at the
Execution Root Directory (where mvn was launched).true
if the current project is at the Execution Rootprivate void validateArtifacts() throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException