Class 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.AbstractMojo
    Attach additional artifacts to be installed and deployed.
    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Artifact[] artifacts
      Attach an array of artifacts to the project.
      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.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      private void validateArtifacts()  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • artifacts

        @Parameter(required=true)
        private Artifact[] artifacts
        Attach an array of artifacts to the project.
      • project

        @Parameter(readonly=true,
                   defaultValue="${project}")
        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 runOnlyAtExecutionRoot
        This 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 skipAttach
        This allows to skip the attach execution in case it is known that the corresponding file does not exists. For example, when the previous ant-run task is skipped with a unless.
        Since:
        1.6
    • Constructor Detail

      • AttachArtifactMojo

        public AttachArtifactMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • validateArtifacts

        private void validateArtifacts()
                                throws org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoFailureException