Class CopyMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.dependency.AbstractDependencyMojo
org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo
org.apache.maven.plugins.dependency.fromConfiguration.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 Summary
FieldsModifier and TypeFieldDescriptionprivate String
The artifact to copy from command line.protected boolean
not used in this goalprivate boolean
Prepend artifact groupId during copyprivate boolean
Strip artifact classifier during copyprivate boolean
Strip artifact version during copyprivate boolean
Use artifact baseVersion during copyFields inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
outputAbsoluteArtifactFilename, reactorProjects, session
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
copyArtifact
(ArtifactItem artifactItem) Resolves the artifact from the repository and copies it to the specified location.protected void
Main entry into mojo.protected ArtifactItemFilter
boolean
boolean
void
setStripClassifier
(boolean stripClassifier) void
setStripVersion
(boolean stripVersion) void
setUseBaseVersion
(boolean useBaseVersion) Methods inherited from class org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo
getArtifact, getArtifactItems, getOutputDirectory, getProcessedArtifactItems, isOverWriteIfNewer, isOverWriteReleases, isOverWriteSnapshots, setArtifact, setArtifactItems, setLocalRepositoryDirectory, setOutputDirectory, setOverWriteIfNewer, setOverWriteReleases, setOverWriteSnapshots, verifyRequirements
Methods inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
copyFile, execute, getProject, isSilent, isSkip, newResolveArtifactProjectBuildingRequest, newResolvePluginProjectBuildingRequest, setSilent, setSkip
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
stripVersion
@Parameter(property="mdep.stripVersion", defaultValue="false") private boolean stripVersionStrip artifact version during copy -
stripClassifier
@Parameter(property="mdep.stripClassifier", defaultValue="false") private boolean stripClassifierStrip artifact classifier during copy -
prependGroupId
@Parameter(property="mdep.prependGroupId", defaultValue="false") private boolean prependGroupIdPrepend artifact groupId during copy- Since:
- 2.7
-
useBaseVersion
@Parameter(property="mdep.useBaseVersion", defaultValue="false") private boolean useBaseVersionUse artifact baseVersion during copy- Since:
- 2.7
-
artifact
The artifact to copy from command line. A string of the form groupId:artifactId:version[:packaging[:classifier]]. UseAbstractFromConfigurationMojo.artifactItems
within the POM configuration. -
ignorePermissions
@Parameter protected boolean ignorePermissionsnot used in this goal
-
-
Constructor Details
-
CopyMojo
public CopyMojo()
-
-
Method Details
-
doExecute
protected void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionMain entry into mojo. This method gets the ArtifactItems and iterates through each one passing it to copyArtifact.- Specified by:
doExecute
in classAbstractDependencyMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
- with a message if an error occurs.org.apache.maven.plugin.MojoFailureException
-MojoFailureException
- See Also:
-
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:
-
getMarkedArtifactFilter
- Specified by:
getMarkedArtifactFilter
in classAbstractFromConfigurationMojo
-
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.
-