Class CopyMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="copy",
          defaultPhase=PROCESS_SOURCES,
          requiresProject=false,
          threadSafe=true)
    public class CopyMojo
    extends AbstractFromConfigurationMojo
    Goal that copies a list of artifacts from the repository to defined locations.
    Since:
    1.0
    • Field Detail

      • stripVersion

        @Parameter(property="mdep.stripVersion",
                   defaultValue="false")
        private boolean stripVersion
        Strip artifact version during copy
      • stripClassifier

        @Parameter(property="mdep.stripClassifier",
                   defaultValue="false")
        private boolean stripClassifier
        Strip artifact classifier during copy
      • prependGroupId

        @Parameter(property="mdep.prependGroupId",
                   defaultValue="false")
        private boolean prependGroupId
        Prepend artifact groupId during copy
        Since:
        2.7
      • useBaseVersion

        @Parameter(property="mdep.useBaseVersion",
                   defaultValue="false")
        private boolean useBaseVersion
        Use artifact baseVersion during copy
        Since:
        2.7
      • artifact

        @Parameter(property="artifact")
        private java.lang.String artifact
        The artifact to copy from command line. A string of the form groupId:artifactId:version[:packaging[:classifier]]. Use AbstractFromConfigurationMojo.artifactItems within the POM configuration.
      • useJvmChmod

        @Parameter
        protected boolean useJvmChmod
        not used in this goal
      • ignorePermissions

        @Parameter
        protected boolean ignorePermissions
        not used in this goal
    • Constructor Detail

      • CopyMojo

        public CopyMojo()
    • Method Detail

      • copyArtifact

        protected void copyArtifact​(ArtifactItem artifactItem)
                             throws org.apache.maven.plugin.MojoExecutionException
        Resolves the artifact from the repository and copies it to the specified location.
        Parameters:
        artifactItem - containing the information about the Artifact to copy.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
        See Also:
        AbstractDependencyMojo.copyFile(File, File)
      • isStripVersion

        public boolean isStripVersion()
        Returns:
        Returns the stripVersion.
      • setStripVersion

        public void setStripVersion​(boolean stripVersion)
        Parameters:
        stripVersion - The stripVersion to set.
      • isStripClassifier

        public boolean isStripClassifier()
        Returns:
        Returns the stripClassifier.
      • setStripClassifier

        public void setStripClassifier​(boolean stripClassifier)
        Parameters:
        stripClassifier - The stripClassifier to set.
      • setUseBaseVersion

        public void setUseBaseVersion​(boolean useBaseVersion)
        Parameters:
        useBaseVersion - The useBaseVersion to set.