public abstract class AbstractDependencyMojo extends AbstractMojo
Modifier and Type | Field and Description |
---|---|
protected ArchiverManager |
archiverManager
To look up Archiver/UnArchiver implementations
|
protected ArtifactCollector |
artifactCollector
Artifact collector, needed to resolve dependencies.
|
protected ArtifactMetadataSource |
artifactMetadataSource |
protected ArtifactFactory |
factory
Used to look up Artifacts in the remote repository.
|
protected boolean |
ignorePermissions
ignore to set file permissions when unpacking a dependency
|
protected boolean |
outputAbsoluteArtifactFilename
Output absolute filename for resolved artifacts
|
protected MavenProject |
project
POM
|
protected List<MavenProject> |
reactorProjects
Contains the full list of projects in the reactor.
|
protected List<ArtifactRepository> |
remoteRepos
List of Remote Repositories used by the resolver
|
protected ArtifactResolver |
resolver
Used to look up Artifacts in the remote repository.
|
protected boolean |
silent
If the plugin should be silent.
|
protected boolean |
useJvmChmod
will use the jvm chmod, this is available for user and all level group level will be ignored
|
Constructor and Description |
---|
AbstractDependencyMojo() |
getPluginContext, setLog, setPluginContext
@Component protected ArtifactFactory factory
@Component protected ArtifactResolver resolver
@Component(role=org.apache.maven.artifact.resolver.ArtifactCollector.class) protected ArtifactCollector artifactCollector
@Component(role=org.apache.maven.artifact.metadata.ArtifactMetadataSource.class, hint="maven") protected ArtifactMetadataSource artifactMetadataSource
@Parameter(defaultValue="${project.remoteArtifactRepositories}", readonly=true, required=true) protected List<ArtifactRepository> remoteRepos
@Component protected ArchiverManager archiverManager
@Parameter(property="dependency.useJvmChmod", defaultValue="true") protected boolean useJvmChmod
will use the jvm chmod, this is available for user and all level group level will be ignored
since 2.6 is on by default@Parameter(property="dependency.ignorePermissions", defaultValue="false") protected boolean ignorePermissions
@Parameter(defaultValue="${project}", readonly=true, required=true) protected MavenProject project
@Parameter(defaultValue="${reactorProjects}", readonly=true) protected List<MavenProject> reactorProjects
@Parameter(property="silent", defaultValue="false") protected boolean silent
@Parameter(property="outputAbsoluteArtifactFilename", defaultValue="false") protected boolean outputAbsoluteArtifactFilename
public final void execute() throws MojoExecutionException, MojoFailureException
protected abstract void doExecute() throws MojoExecutionException, MojoFailureException
public Log getLog()
getLog
in interface Mojo
getLog
in class AbstractMojo
public ArchiverManager getArchiverManager()
protected void copyFile(File artifact, File destFile) throws MojoExecutionException
artifact
- represents the file to copy.destFile
- file name of destination file.MojoExecutionException
- with a message if an
error occurs.protected void unpack(Artifact artifact, File location) throws MojoExecutionException
MojoExecutionException
protected void unpack(Artifact artifact, File location, String includes, String excludes) throws MojoExecutionException
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,
**/*.properties
excludes
- Comma separated list of file patterns to exclude i.e. **/*.xml,
**/*.properties
MojoExecutionException
public ArtifactFactory getFactory()
public void setFactory(ArtifactFactory factory)
factory
- The factory to set.public MavenProject getProject()
protected ArtifactRepository getLocal()
public void setLocal(ArtifactRepository local)
local
- The local to set.public List<ArtifactRepository> getRemoteRepos()
public void setRemoteRepos(List<ArtifactRepository> remoteRepos)
remoteRepos
- The remoteRepos to set.public ArtifactResolver getResolver()
public void setResolver(ArtifactResolver resolver)
resolver
- The resolver to set.public void setArchiverManager(ArchiverManager archiverManager)
archiverManager
- The archiverManager to set.public ArtifactCollector getArtifactCollector()
public void setArtifactCollector(ArtifactCollector theArtifactCollector)
theArtifactCollector
- The artifactCollector to set.public ArtifactMetadataSource getArtifactMetadataSource()
public void setArtifactMetadataSource(ArtifactMetadataSource theArtifactMetadataSource)
theArtifactMetadataSource
- The artifactMetadataSource to set.public boolean isUseJvmChmod()
public void setUseJvmChmod(boolean useJvmChmod)
public boolean isSkip()
public void setSkip(boolean skip)
Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.