@Mojo(name="copy-dependencies", requiresDependencyResolution=TEST, defaultPhase=PROCESS_SOURCES, threadSafe=true) public class CopyDependenciesMojo extends AbstractFromDependenciesMojo
Modifier and Type | Field and Description |
---|---|
protected boolean |
addParentPoms
Add parent poms to the list of copied dependencies (both current project pom parents and dependencies parents).
|
protected boolean |
copyPom
Also copy the pom of each artifact.
|
protected boolean |
ignorePermissions
not used in this goal
|
protected boolean |
useBaseVersion
Either append the artifact's baseVersion or uniqueVersion to the filename.
|
failOnMissingClassifierArtifact, outputDirectory, stripClassifier, stripType, stripVersion, useRepositoryLayout, useSubDirectoryPerArtifact, useSubDirectoryPerScope, useSubDirectoryPerType
classifier, excludeArtifactIds, excludeClassifiers, excludeGroupIds, excludeScope, excludeTransitive, excludeTypes, includeArtifactIds, includeClassifiers, includeGroupIds, includeScope, includeTypes, markersDirectory, overWriteIfNewer, overWriteReleases, overWriteSnapshots, prependGroupId, type
outputAbsoluteArtifactFilename, reactorProjects, session
Constructor and Description |
---|
CopyDependenciesMojo() |
Modifier and Type | Method and Description |
---|---|
protected void |
copyArtifact(org.apache.maven.artifact.Artifact artifact,
boolean removeVersion,
boolean prependGroupId,
boolean theUseBaseVersion)
Copies the Artifact after building the destination file name if overridden.
|
protected void |
copyArtifact(org.apache.maven.artifact.Artifact artifact,
boolean removeVersion,
boolean prependGroupId,
boolean theUseBaseVersion,
boolean removeClassifier)
Copies the Artifact after building the destination file name if overridden.
|
void |
copyPoms(File destDir,
Set<org.apache.maven.artifact.Artifact> artifacts,
boolean removeVersion)
Copy the pom files associated with the artifacts.
|
void |
copyPoms(File destDir,
Set<org.apache.maven.artifact.Artifact> artifacts,
boolean removeVersion,
boolean removeClassifier)
Copy the pom files associated with the artifacts.
|
protected void |
doExecute()
Main entry into mojo.
|
protected org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter |
getMarkedArtifactFilter()
Return an
ArtifactsFilter indicating which artifacts must be filtered out. |
protected org.apache.maven.artifact.Artifact |
getResolvedPomArtifact(org.apache.maven.artifact.Artifact artifact) |
boolean |
isCopyPom() |
void |
setCopyPom(boolean copyPom) |
getOutputDirectory, isFailOnMissingClassifierArtifact, isStripType, isStripVersion, isUseRepositoryLayout, isUseSubDirectoryPerArtifact, isUseSubDirectoryPerScope, isUseSubDirectoryPerType, setFailOnMissingClassifierArtifact, setOutputDirectory, setStripType, setStripVersion, setUseRepositoryLayout, setUseSubDirectoryPerArtifact, setUseSubDirectoryPerScope, setUseSubDirectoryPerType
filterMarkedDependencies, getArtifactResolver, getClassifierTranslatedDependencies, getDependencyResolver, getDependencySets, getDependencySets, getMarkersDirectory, getRepositoryManager, getResolvedDependencies, isPrependGroupId, resolve, setMarkersDirectory, setPrependGroupId
copyFile, execute, getProject, isSilent, isSkip, newResolveArtifactProjectBuildingRequest, newResolvePluginProjectBuildingRequest, setSilent, setSkip
@Parameter(property="mdep.copyPom", defaultValue="false") protected boolean copyPom
@Parameter(property="mdep.useBaseVersion", defaultValue="true") protected boolean useBaseVersion
AbstractFromDependenciesMojo.isStripVersion()
is false
.@Parameter(property="mdep.addParentPoms", defaultValue="false") protected boolean addParentPoms
@Parameter protected boolean ignorePermissions
protected void doExecute() throws org.apache.maven.plugin.MojoExecutionException
doExecute
in class AbstractDependencyMojo
org.apache.maven.plugin.MojoExecutionException
- with a message if an error occurs.AbstractDependencyFilterMojo.getDependencySets(boolean, boolean)
,
copyArtifact(Artifact, boolean, boolean, boolean, boolean)
protected void copyArtifact(org.apache.maven.artifact.Artifact artifact, boolean removeVersion, boolean prependGroupId, boolean theUseBaseVersion) throws org.apache.maven.plugin.MojoExecutionException
artifact
- representing the object to be copied.removeVersion
- specifies if the version should be removed from the file name when copying.prependGroupId
- specifies if the groupId should be prepend to the file while copying.theUseBaseVersion
- specifies if the baseVersion of the artifact should be used instead of the version.org.apache.maven.plugin.MojoExecutionException
- with a message if an error occurs.copyArtifact(Artifact, boolean, boolean, boolean, boolean)
protected void copyArtifact(org.apache.maven.artifact.Artifact artifact, boolean removeVersion, boolean prependGroupId, boolean theUseBaseVersion, boolean removeClassifier) throws org.apache.maven.plugin.MojoExecutionException
artifact
- representing the object to be copied.removeVersion
- specifies if the version should be removed from the file name when copying.prependGroupId
- specifies if the groupId should be prepend to the file while copying.theUseBaseVersion
- specifies if the baseVersion of the artifact should be used instead of the version.removeClassifier
- specifies if the classifier should be removed from the file name when copying.org.apache.maven.plugin.MojoExecutionException
- with a message if an error occurs.AbstractDependencyMojo.copyFile(File, File)
,
DependencyUtil.getFormattedOutputDirectory(boolean, boolean, boolean, boolean, boolean, boolean, File, Artifact)
public void copyPoms(File destDir, Set<org.apache.maven.artifact.Artifact> artifacts, boolean removeVersion) throws org.apache.maven.plugin.MojoExecutionException
destDir
- The destination directory File
.artifacts
- The artifacts Artifact
.removeVersion
- remove version or not.org.apache.maven.plugin.MojoExecutionException
- in case of errors.public void copyPoms(File destDir, Set<org.apache.maven.artifact.Artifact> artifacts, boolean removeVersion, boolean removeClassifier) throws org.apache.maven.plugin.MojoExecutionException
destDir
- The destination directory File
.artifacts
- The artifacts Artifact
.removeVersion
- remove version or not.removeClassifier
- remove the classifier or not.org.apache.maven.plugin.MojoExecutionException
- in case of errors.protected org.apache.maven.artifact.Artifact getResolvedPomArtifact(org.apache.maven.artifact.Artifact artifact)
artifact
- Artifact
Artifact
protected org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()
AbstractDependencyFilterMojo
ArtifactsFilter
indicating which artifacts must be filtered out.getMarkedArtifactFilter
in class AbstractDependencyFilterMojo
ArtifactsFilter
indicating which artifacts must be filtered out.public boolean isCopyPom()
public void setCopyPom(boolean copyPom)
copyPom
- - true if the pom of each artifact must be copiedCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.