Class UnpackMojo
- 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.UnpackMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="unpack", defaultPhase=PROCESS_SOURCES, requiresProject=false, threadSafe=true) public class UnpackMojo extends AbstractFromConfigurationMojo
Goal that retrieves a list of artifacts from the repository and unpacks them in a defined location.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
artifact
The artifact to unpack from command line.private java.lang.String
excludes
A comma separated list of file patterns to exclude when unpacking the artifact.private org.codehaus.plexus.components.io.filemappers.FileMapper[]
fileMappers
FileMapper
to be used for rewriting each target path, ornull
if no rewriting shall happen.private java.lang.String
includes
A comma separated list of file patterns to include when unpacking the artifact.private java.io.File
markersDirectory
Directory to store flag files after unpack-
Fields inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
outputAbsoluteArtifactFilename, reactorProjects, session
-
-
Constructor Summary
Constructors Constructor Description UnpackMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doExecute()
Main entry into mojo.java.lang.String
getExcludes()
org.codehaus.plexus.components.io.filemappers.FileMapper[]
getFileMappers()
java.lang.String
getIncludes()
(package private) ArtifactItemFilter
getMarkedArtifactFilter(ArtifactItem item)
java.io.File
getMarkersDirectory()
protected java.util.List<ArtifactItem>
getProcessedArtifactItems(boolean removeVersion)
void
setExcludes(java.lang.String excludes)
void
setFileMappers(org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)
void
setIncludes(java.lang.String includes)
void
setMarkersDirectory(java.io.File theMarkersDirectory)
private void
unpackArtifact(ArtifactItem artifactItem)
This method gets the Artifact object and calls DependencyUtil.unpackFile.-
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, getArchiverManager, getProject, isSilent, isSkip, isUseJvmChmod, newResolveArtifactProjectBuildingRequest, setArchiverManager, setSilent, setSkip, setUseJvmChmod, unpack, unpack, unpack
-
-
-
-
Field Detail
-
markersDirectory
@Parameter(defaultValue="${project.build.directory}/dependency-maven-plugin-markers") private java.io.File markersDirectory
Directory to store flag files after unpack
-
includes
@Parameter(property="mdep.unpack.includes") private java.lang.String includes
A comma separated list of file patterns to include when unpacking the artifact. i.e.**/*.xml,**/*.properties
NOTE: Excludes patterns override the includes. (component code =return isIncluded( name ) AND !isExcluded( name );
)- Since:
- 2.0-alpha-5
-
excludes
@Parameter(property="mdep.unpack.excludes") private java.lang.String excludes
A comma separated list of file patterns to exclude when unpacking the artifact. i.e. **\/*.xml,**\/*.properties**/*.xml,**/*.properties
NOTE: Excludes patterns override the includes. (component code =return isIncluded( name ) AND !isExcluded( name );
)- Since:
- 2.0-alpha-5
-
fileMappers
@Parameter(property="mdep.unpack.filemappers") private org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers
FileMapper
to be used for rewriting each target path, ornull
if no rewriting shall happen.- Since:
- 3.1.2
-
artifact
@Parameter(property="artifact") private java.lang.String artifact
The artifact to unpack from command line. A string of the formgroupId:artifactId:version[:packaging[:classifier]]
. UseAbstractFromConfigurationMojo.artifactItems
within the POM configuration.
-
-
Method Detail
-
doExecute
protected void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Main entry into mojo. This method gets the ArtifactItems and iterates through each one passing it to unpackArtifact.- 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:
ArtifactItem
,AbstractFromConfigurationMojo.getArtifactItems()
,unpackArtifact(ArtifactItem)
-
unpackArtifact
private void unpackArtifact(ArtifactItem artifactItem) throws org.apache.maven.plugin.MojoExecutionException
This method gets the Artifact object and calls DependencyUtil.unpackFile.- Parameters:
artifactItem
- containing the information about the Artifact to unpack.- Throws:
org.apache.maven.plugin.MojoExecutionException
- with a message if an error occurs.- See Also:
AbstractFromConfigurationMojo.getArtifact(org.apache.maven.plugins.dependency.fromConfiguration.ArtifactItem)
-
getMarkedArtifactFilter
ArtifactItemFilter getMarkedArtifactFilter(ArtifactItem item)
- Specified by:
getMarkedArtifactFilter
in classAbstractFromConfigurationMojo
-
getProcessedArtifactItems
protected java.util.List<ArtifactItem> getProcessedArtifactItems(boolean removeVersion) throws org.apache.maven.plugin.MojoExecutionException
- Parameters:
removeVersion
- removeVersion.- Returns:
- list of
ArtifactItem
- Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of an error.
-
getMarkersDirectory
public java.io.File getMarkersDirectory()
- Returns:
- Returns the markersDirectory.
-
setMarkersDirectory
public void setMarkersDirectory(java.io.File theMarkersDirectory)
- Parameters:
theMarkersDirectory
- The markersDirectory to set.
-
getExcludes
public java.lang.String getExcludes()
- Returns:
- Returns a comma separated list of excluded items
-
setExcludes
public void setExcludes(java.lang.String excludes)
- Parameters:
excludes
- A comma separated list of items to exclude i.e. **\/*.xml, **\/*.properties
-
getIncludes
public java.lang.String getIncludes()
- Returns:
- Returns a comma separated list of included items
-
setIncludes
public void setIncludes(java.lang.String includes)
- Parameters:
includes
- A comma separated list of items to include i.e. **\/*.xml, **\/*.properties
-
getFileMappers
public org.codehaus.plexus.components.io.filemappers.FileMapper[] getFileMappers()
- Returns:
FileMapper
s to be used for rewriting each target path, ornull
if no rewriting shall happen.- Since:
- 3.1.2
-
setFileMappers
public void setFileMappers(org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)
- Parameters:
fileMappers
-FileMapper
s to be used for rewriting each target path, ornull
if no rewriting shall happen.- Since:
- 3.1.2
-
-