Class AbstractDependencyMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.dependency.AbstractDependencyMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractDependencyFilterMojo,AbstractFromConfigurationMojo,ListRepositoriesMojo
public abstract class AbstractDependencyMojo extends org.apache.maven.plugin.AbstractMojo- Author:
- Brian Fox
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanoutputAbsoluteArtifactFilenameOutput absolute filename for resolved artifactsprotected List<org.apache.maven.project.MavenProject>reactorProjectsContains the full list of projects in the reactor.protected org.apache.maven.execution.MavenSessionsessionThe Maven session
-
Constructor Summary
Constructors Constructor Description AbstractDependencyMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcopyFile(File artifact, File destFile)Does the actual copy of the file and logging.protected abstract voiddoExecute()voidexecute()org.codehaus.plexus.archiver.manager.ArchiverManagergetArchiverManager()org.apache.maven.project.MavenProjectgetProject()protected booleanisSilent()booleanisSkip()booleanisUseJvmChmod()org.apache.maven.project.ProjectBuildingRequestnewResolveArtifactProjectBuildingRequest()voidsetArchiverManager(org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager)voidsetSilent(boolean silent)voidsetSkip(boolean skip)voidsetUseJvmChmod(boolean useJvmChmod)protected voidunpack(org.apache.maven.artifact.Artifact artifact, File location, String includes, String excludes, String encoding, org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)Unpacks the archive file.protected voidunpack(org.apache.maven.artifact.Artifact artifact, File location, String encoding, org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)protected voidunpack(org.apache.maven.artifact.Artifact artifact, String type, File location, String includes, String excludes, String encoding, org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)
-
-
-
Field Detail
-
reactorProjects
@Parameter(defaultValue="${reactorProjects}", readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjectsContains the full list of projects in the reactor.
-
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession sessionThe Maven session
-
outputAbsoluteArtifactFilename
@Parameter(property="outputAbsoluteArtifactFilename", defaultValue="false") protected boolean outputAbsoluteArtifactFilenameOutput absolute filename for resolved artifacts- Since:
- 2.0
-
-
Method Detail
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
doExecute
protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionException-MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException-MojoFailureException
-
getArchiverManager
public org.codehaus.plexus.archiver.manager.ArchiverManager getArchiverManager()
- Returns:
- Returns the archiverManager.
-
copyFile
protected void copyFile(File artifact, File destFile) throws org.apache.maven.plugin.MojoExecutionException
Does the actual copy of the file and logging.- Parameters:
artifact- represents the file to copy.destFile- file name of destination file.- Throws:
org.apache.maven.plugin.MojoExecutionException- with a message if an error occurs.
-
unpack
protected void unpack(org.apache.maven.artifact.Artifact artifact, File location, String encoding, org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers) throws org.apache.maven.plugin.MojoExecutionException- Parameters:
artifact-Artifactlocation- The location.encoding- The encoding.fileMappers-FileMappers to be used for rewriting each target path, ornullif no rewriting shall happen.- Throws:
org.apache.maven.plugin.MojoExecutionException- in case of an error.
-
unpack
protected void unpack(org.apache.maven.artifact.Artifact artifact, File location, String includes, String excludes, String encoding, org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers) throws org.apache.maven.plugin.MojoExecutionExceptionUnpacks the archive file.- Parameters:
artifact- File to be unpacked.location- Location where to put the unpacked files.includes- Comma separated list of file patterns to include i.e.**/.xml, **/*.propertiesexcludes- Comma separated list of file patterns to exclude i.e.**/*.xml, **/*.propertiesencoding- Encoding of artifact. Setnullfor default encoding.fileMappers-FileMappers to be used for rewriting each target path, ornullif no rewriting shall happen.- Throws:
org.apache.maven.plugin.MojoExecutionException- In case of errors.
-
unpack
protected void unpack(org.apache.maven.artifact.Artifact artifact, String type, File location, String includes, String excludes, String encoding, org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers) throws org.apache.maven.plugin.MojoExecutionException- Parameters:
artifact-Artifacttype- The type.location- The location.includes- includes list.excludes- excludes list.encoding- the encoding.fileMappers-FileMappers to be used for rewriting each target path, ornullif no rewriting shall happen.- Throws:
org.apache.maven.plugin.MojoExecutionException- in case of an error.
-
newResolveArtifactProjectBuildingRequest
public org.apache.maven.project.ProjectBuildingRequest newResolveArtifactProjectBuildingRequest()
- Returns:
- Returns a new ProjectBuildingRequest populated from the current session and the current project remote repositories, used to resolve artifacts.
-
getProject
public org.apache.maven.project.MavenProject getProject()
- Returns:
- Returns the project.
-
setArchiverManager
public void setArchiverManager(org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager)
- Parameters:
archiverManager- The archiverManager to set.
-
isUseJvmChmod
public boolean isUseJvmChmod()
- Returns:
useJvmChmod
-
setUseJvmChmod
public void setUseJvmChmod(boolean useJvmChmod)
- Parameters:
useJvmChmod-useJvmChmod
-
isSkip
public boolean isSkip()
- Returns:
skip
-
setSkip
public void setSkip(boolean skip)
- Parameters:
skip-skip
-
isSilent
protected final boolean isSilent()
- Returns:
silent
-
setSilent
public void setSilent(boolean silent)
- Parameters:
silent-silent
-
-