org.apache.maven.plugin.dependency
Class AbstractDependencyFilterMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.dependency.AbstractDependencyMojo
          extended by org.apache.maven.plugin.dependency.AbstractDependencyFilterMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractFromDependenciesMojo, AbstractResolveMojo, BuildClasspathMojo

public abstract class AbstractDependencyFilterMojo
extends AbstractDependencyMojo

Class that encapsulates the plugin parameters, and contains methods that handle dependency filtering

Version:
$Id: AbstractDependencyFilterMojo.java 1085777 2011-03-26 18:13:19Z hboutemy $
Author:
Brian Fox
See Also:
AbstractDependencyMojo

Field Summary
protected  String classifier
          Specify classifier to look for.
protected  String excludeArtifactIds
          Comma separated list of Artifact names too exclude.
protected  String excludeClassifiers
          Comma Separated list of Classifiers to exclude.
protected  String excludeGroupIds
          Comma separated list of GroupId Names to exclude.
protected  String excludeScope
          Scope to exclude.
protected  boolean excludeTransitive
          If we should exclude transitive dependencies
protected  String excludeTypes
          Comma Separated list of Types to exclude.
protected  String includeArtifactIds
          Comma separated list of Artifact names to include.
protected  String includeClassifiers
          Comma Separated list of Classifiers to include.
protected  String includeGroupIds
          Comma separated list of GroupIds to include.
protected  String includeScope
          Scope to include.
protected  String includeTypes
          Comma Separated list of Types to include.
protected  File markersDirectory
          Directory to store flag files
protected  boolean overWriteIfNewer
          Overwrite artifacts that don't exist or are older than the source.
protected  boolean overWriteReleases
          Overwrite release artifacts
protected  boolean overWriteSnapshots
          Overwrite snapshot artifacts
protected  boolean prependGroupId
          Prepend the groupId during copy.
protected  String type
          Specify type to look for when constructing artifact based on classifier.
 
Fields inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo
archiverManager, artifactCollector, artifactMetadataSource, factory, outputAbsoluteArtifactFilename, project, reactorProjects, remoteRepos, resolver, silent
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractDependencyFilterMojo()
           
 
Method Summary
protected  DependencyStatusSets filterMarkedDependencies(Set<org.apache.maven.artifact.Artifact> artifacts)
          Filter the marked dependencies
protected  DependencyStatusSets getClassifierTranslatedDependencies(Set<org.apache.maven.artifact.Artifact> artifacts, boolean stopOnFailure)
          Transform artifacts
protected  DependencyStatusSets getDependencySets(boolean stopOnFailure)
          Method creates filters and filters the projects dependencies.
protected abstract  org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()
           
 File getMarkersDirectory()
           
protected  Set<org.apache.maven.artifact.Artifact> getResolvedDependencies(boolean stopOnFailure)
          Retrieves dependencies, either direct only or all including transitive.
 boolean isPrependGroupId()
           
 void setMarkersDirectory(File theMarkersDirectory)
           
 void setPrependGroupId(boolean prependGroupId)
           
 
Methods inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo
copyFile, getArchiverManager, getArtifactCollector, getArtifactMetadataSource, getFactory, getLocal, getLog, getProject, getRemoteRepos, getResolver, setArchiverManager, setArtifactCollector, setArtifactMetadataSource, setFactory, setLocal, setRemoteRepos, setResolver, unpack, unpack
 
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

excludeTransitive

protected boolean excludeTransitive
If we should exclude transitive dependencies

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

includeTypes

protected String includeTypes
Comma Separated list of Types to include. Empty String indicates include everything (default).

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

excludeTypes

protected String excludeTypes
Comma Separated list of Types to exclude. Empty String indicates don't exclude anything (default).

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

includeScope

protected String includeScope
Scope to include. An Empty string indicates all scopes (default).

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

excludeScope

protected String excludeScope
Scope to exclude. An Empty string indicates no scopes (default).

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

includeClassifiers

protected String includeClassifiers
Comma Separated list of Classifiers to include. Empty String indicates include everything (default).

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

excludeClassifiers

protected String excludeClassifiers
Comma Separated list of Classifiers to exclude. Empty String indicates don't exclude anything (default).

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

classifier

protected String classifier
Specify classifier to look for. Example: sources

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

type

protected String type
Specify type to look for when constructing artifact based on classifier. Example: java-source,jar,war

Since:
2.0
Is defined by:
expression:
${type}
default-value:
java-source

excludeArtifactIds

protected String excludeArtifactIds
Comma separated list of Artifact names too exclude.

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

includeArtifactIds

protected String includeArtifactIds
Comma separated list of Artifact names to include.

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

excludeGroupIds

protected String excludeGroupIds
Comma separated list of GroupId Names to exclude.

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

includeGroupIds

protected String includeGroupIds
Comma separated list of GroupIds to include.

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

markersDirectory

protected File markersDirectory
Directory to store flag files

Since:
2.0
Is defined by:
expression:
${markersDirectory}
default-value:
${project.build.directory}/dependency-maven-plugin-markers

overWriteReleases

protected boolean overWriteReleases
Overwrite release artifacts

Since:
1.0
Is defined by:
expression:
${overWriteReleases}
default-value:
false

overWriteSnapshots

protected boolean overWriteSnapshots
Overwrite snapshot artifacts

Since:
1.0
Is defined by:
expression:
${overWriteSnapshots}
default-value:
false

overWriteIfNewer

protected boolean overWriteIfNewer
Overwrite artifacts that don't exist or are older than the source.

Since:
2.0
Is defined by:
expression:
${overWriteIfNewer}
default-value:
true

prependGroupId

protected boolean prependGroupId
Prepend the groupId during copy.

Since:
2.2
Is defined by:
expression:
${mdep.prependGroupId}
default-value:
false
Is defined by:
Constructor Detail

AbstractDependencyFilterMojo

public AbstractDependencyFilterMojo()
Method Detail

getMarkedArtifactFilter

protected abstract org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()

getResolvedDependencies

protected Set<org.apache.maven.artifact.Artifact> getResolvedDependencies(boolean stopOnFailure)
                                                                   throws org.apache.maven.plugin.MojoExecutionException
Retrieves dependencies, either direct only or all including transitive.

Returns:
A HashSet of artifacts
Throws:
org.apache.maven.plugin.MojoExecutionException

getDependencySets

protected DependencyStatusSets getDependencySets(boolean stopOnFailure)
                                          throws org.apache.maven.plugin.MojoExecutionException
Method creates filters and filters the projects dependencies. This method also transforms the dependencies if classifier is set. The dependencies are filtered in least specific to most specific order

Parameters:
stopOnFailure -
Returns:
DependencyStatusSets - Bean of TreeSets that contains information on the projects dependencies
Throws:
org.apache.maven.plugin.MojoExecutionException

getClassifierTranslatedDependencies

protected DependencyStatusSets getClassifierTranslatedDependencies(Set<org.apache.maven.artifact.Artifact> artifacts,
                                                                   boolean stopOnFailure)
                                                            throws org.apache.maven.plugin.MojoExecutionException
Transform artifacts

Parameters:
artifacts -
stopOnFailure -
Returns:
DependencyStatusSets - Bean of TreeSets that contains information on the projects dependencies
Throws:
org.apache.maven.plugin.MojoExecutionException

filterMarkedDependencies

protected DependencyStatusSets filterMarkedDependencies(Set<org.apache.maven.artifact.Artifact> artifacts)
                                                 throws org.apache.maven.plugin.MojoExecutionException
Filter the marked dependencies

Parameters:
artifacts -
Returns:
Throws:
org.apache.maven.plugin.MojoExecutionException

getMarkersDirectory

public File getMarkersDirectory()
Returns:
Returns the markersDirectory.

setMarkersDirectory

public void setMarkersDirectory(File theMarkersDirectory)
Parameters:
theMarkersDirectory - The markersDirectory to set.

isPrependGroupId

public boolean isPrependGroupId()
Returns:
true, if the groupId should be prepended to the filename.

setPrependGroupId

public void setPrependGroupId(boolean prependGroupId)
Parameters:
prependGroupId - - true if the groupId must be prepended during the copy.


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