org.apache.maven.plugin.dependency
Class AbstractDependencyMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.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

Version:
$Id: AbstractDependencyMojo.java 552528 2007-07-02 16:12:47Z markh $
Author:
Brian Fox

Field Summary
protected  org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
          To look up Archiver/UnArchiver implementations
protected  org.apache.maven.artifact.resolver.ArtifactCollector artifactCollector
          Artifact collector, needed to resolve dependencies.
protected  org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
           
protected  org.apache.maven.artifact.factory.ArtifactFactory factory
          Used to look up Artifacts in the remote repository.
protected  boolean outputAbsoluteArtifactFilename
          Output absolute filename for resolved artifacts
protected  org.apache.maven.project.MavenProject project
          POM
protected  List<org.apache.maven.project.MavenProject> reactorProjects
          Contains the full list of projects in the reactor.
protected  List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos
          List of Remote Repositories used by the resolver
protected  org.apache.maven.artifact.resolver.ArtifactResolver resolver
          Used to look up Artifacts in the remote repository.
 boolean silent
          If the plugin should be silent.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractDependencyMojo()
           
 
Method Summary
protected  void copyFile(File artifact, File destFile)
          Does the actual copy of the file and logging.
 org.codehaus.plexus.archiver.manager.ArchiverManager getArchiverManager()
           
 org.apache.maven.artifact.resolver.ArtifactCollector getArtifactCollector()
           
 org.apache.maven.artifact.metadata.ArtifactMetadataSource getArtifactMetadataSource()
           
 org.apache.maven.artifact.factory.ArtifactFactory getFactory()
           
protected  org.apache.maven.artifact.repository.ArtifactRepository getLocal()
           
 org.apache.maven.plugin.logging.Log getLog()
           
 org.apache.maven.project.MavenProject getProject()
           
 List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepos()
           
 org.apache.maven.artifact.resolver.ArtifactResolver getResolver()
           
 void setArchiverManager(org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager)
           
 void setArtifactCollector(org.apache.maven.artifact.resolver.ArtifactCollector theArtifactCollector)
           
 void setArtifactMetadataSource(org.apache.maven.artifact.metadata.ArtifactMetadataSource theArtifactMetadataSource)
           
 void setFactory(org.apache.maven.artifact.factory.ArtifactFactory factory)
           
 void setLocal(org.apache.maven.artifact.repository.ArtifactRepository local)
           
 void setRemoteRepos(List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)
           
 void setResolver(org.apache.maven.artifact.resolver.ArtifactResolver resolver)
           
protected  void unpack(File file, File location)
           
protected  void unpack(File file, File location, String includes, String excludes)
          Unpacks the archive file.
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

factory

protected org.apache.maven.artifact.factory.ArtifactFactory factory
Used to look up Artifacts in the remote repository.

Is a Plexus component defined by:

resolver

protected org.apache.maven.artifact.resolver.ArtifactResolver resolver
Used to look up Artifacts in the remote repository.

Is a Plexus component defined by:

artifactCollector

protected org.apache.maven.artifact.resolver.ArtifactCollector artifactCollector
Artifact collector, needed to resolve dependencies.

Is a Plexus component defined by:
role:
org.apache.maven.artifact.resolver.ArtifactCollector
Is readonly.
Is required.

artifactMetadataSource

protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
Is a Plexus component defined by:
role:
org.apache.maven.artifact.metadata.ArtifactMetadataSource
hint:
maven
Is readonly.
Is required.

remoteRepos

protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos
List of Remote Repositories used by the resolver

Is defined by:
expression:
${project.remoteArtifactRepositories}
Is readonly.
Is required.

archiverManager

protected org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
To look up Archiver/UnArchiver implementations

Is a Plexus component defined by:

project

protected org.apache.maven.project.MavenProject project
POM

Is defined by:
expression:
${project}
Is readonly.
Is required.

reactorProjects

protected List<org.apache.maven.project.MavenProject> reactorProjects
Contains the full list of projects in the reactor.

Is defined by:
expression:
${reactorProjects}
Is readonly.
Is required.

silent

public boolean silent
If the plugin should be silent.

Since:
2.0
Is defined by:
expression:
${silent}
default-value:
false

outputAbsoluteArtifactFilename

protected boolean outputAbsoluteArtifactFilename
Output absolute filename for resolved artifacts

Since:
2.0
Is defined by:
expression:
${outputAbsoluteArtifactFilename}
default-value:
false
Constructor Detail

AbstractDependencyMojo

public AbstractDependencyMojo()
Method Detail

getLog

public org.apache.maven.plugin.logging.Log getLog()
Specified by:
getLog in interface org.apache.maven.plugin.Mojo
Overrides:
getLog in class org.apache.maven.plugin.AbstractMojo
Returns:
Returns the log.

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(File file,
                      File location)
               throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

unpack

protected void unpack(File file,
                      File location,
                      String includes,
                      String excludes)
               throws org.apache.maven.plugin.MojoExecutionException
Unpacks the archive file.

Parameters:
file - 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
Throws:
org.apache.maven.plugin.MojoExecutionException

getFactory

public org.apache.maven.artifact.factory.ArtifactFactory getFactory()
Returns:
Returns the factory.

setFactory

public void setFactory(org.apache.maven.artifact.factory.ArtifactFactory factory)
Parameters:
factory - The factory to set.

getProject

public org.apache.maven.project.MavenProject getProject()
Returns:
Returns the project.

getLocal

protected org.apache.maven.artifact.repository.ArtifactRepository getLocal()
Returns:
Returns the local.

setLocal

public void setLocal(org.apache.maven.artifact.repository.ArtifactRepository local)
Parameters:
local - The local to set.

getRemoteRepos

public List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepos()
Returns:
Returns the remoteRepos.

setRemoteRepos

public void setRemoteRepos(List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)
Parameters:
remoteRepos - The remoteRepos to set.

getResolver

public org.apache.maven.artifact.resolver.ArtifactResolver getResolver()
Returns:
Returns the resolver.

setResolver

public void setResolver(org.apache.maven.artifact.resolver.ArtifactResolver resolver)
Parameters:
resolver - The resolver to set.

setArchiverManager

public void setArchiverManager(org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager)
Parameters:
archiverManager - The archiverManager to set.

getArtifactCollector

public org.apache.maven.artifact.resolver.ArtifactCollector getArtifactCollector()
Returns:
Returns the artifactCollector.

setArtifactCollector

public void setArtifactCollector(org.apache.maven.artifact.resolver.ArtifactCollector theArtifactCollector)
Parameters:
theArtifactCollector - The artifactCollector to set.

getArtifactMetadataSource

public org.apache.maven.artifact.metadata.ArtifactMetadataSource getArtifactMetadataSource()
Returns:
Returns the artifactMetadataSource.

setArtifactMetadataSource

public void setArtifactMetadataSource(org.apache.maven.artifact.metadata.ArtifactMetadataSource theArtifactMetadataSource)
Parameters:
theArtifactMetadataSource - The artifactMetadataSource to set.


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.