org.apache.maven.plugin.dependency.fromDependencies
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.fromDependencies.AbstractDependencyFilterMojo
All Implemented Interfaces:
ContextEnabled, 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.html 861760 2013-05-12 17:31:26Z 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 to 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, ignorePermissions, outputAbsoluteArtifactFilename, project, reactorProjects, remoteRepos, resolver, silent, useJvmChmod
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractDependencyFilterMojo()
           
 
Method Summary
protected  DependencyStatusSets filterMarkedDependencies(Set<Artifact> artifacts)
          Filter the marked dependencies
protected  DependencyStatusSets getClassifierTranslatedDependencies(Set<Artifact> artifacts, boolean stopOnFailure)
          Transform artifacts
protected  DependencyStatusSets getDependencySets(boolean stopOnFailure)
           
protected  DependencyStatusSets getDependencySets(boolean stopOnFailure, boolean includeParents)
          Method creates filters and filters the projects dependencies.
protected abstract  ArtifactsFilter getMarkedArtifactFilter()
          Return an ArtifactsFilter indicating which artifacts must be filtered out.
 File getMarkersDirectory()
           
protected  Set<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, doExecute, execute, getArchiverManager, getArtifactCollector, getArtifactMetadataSource, getFactory, getLocal, getLog, getProject, getRemoteRepos, getResolver, isSkip, isUseJvmChmod, setArchiverManager, setArtifactCollector, setArtifactMetadataSource, setFactory, setLocal, setRemoteRepos, setResolver, setSkip, setUseJvmChmod, 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
 

Field Detail

overWriteReleases

@Parameter(property="overWriteReleases",
           defaultValue="false")
protected boolean overWriteReleases
Overwrite release artifacts

Since:
1.0

overWriteSnapshots

@Parameter(property="overWriteSnapshots",
           defaultValue="false")
protected boolean overWriteSnapshots
Overwrite snapshot artifacts

Since:
1.0

overWriteIfNewer

@Parameter(property="overWriteIfNewer",
           defaultValue="true")
protected boolean overWriteIfNewer
Overwrite artifacts that don't exist or are older than the source.

Since:
2.0

excludeTransitive

@Parameter(property="excludeTransitive",
           defaultValue="false")
protected boolean excludeTransitive
If we should exclude transitive dependencies

Since:
2.0

includeTypes

@Parameter(property="includeTypes",
           defaultValue="")
protected String includeTypes
Comma Separated list of Types to include. Empty String indicates include everything (default).

Since:
2.0

excludeTypes

@Parameter(property="excludeTypes",
           defaultValue="")
protected String excludeTypes
Comma Separated list of Types to exclude. Empty String indicates don't exclude anything (default).

Since:
2.0

includeScope

@Parameter(property="includeScope",
           defaultValue="")
protected String includeScope
Scope to include. An Empty string indicates all scopes (default). The scopes being interpreted are the scopes as Maven sees them, not as specified in the pom. In summary:

Since:
2.0

excludeScope

@Parameter(property="excludeScope",
           defaultValue="")
protected String excludeScope
Scope to exclude. An Empty string indicates no scopes (default).

Since:
2.0

includeClassifiers

@Parameter(property="includeClassifiers",
           defaultValue="")
protected String includeClassifiers
Comma Separated list of Classifiers to include. Empty String indicates include everything (default).

Since:
2.0

excludeClassifiers

@Parameter(property="excludeClassifiers",
           defaultValue="")
protected String excludeClassifiers
Comma Separated list of Classifiers to exclude. Empty String indicates don't exclude anything (default).

Since:
2.0

classifier

@Parameter(property="classifier",
           defaultValue="")
protected String classifier
Specify classifier to look for. Example: sources

Since:
2.0

type

@Parameter(property="type",
           defaultValue="")
protected String type
Specify type to look for when constructing artifact based on classifier. Example: java-source,jar,war

Since:
2.0

excludeArtifactIds

@Parameter(property="excludeArtifactIds",
           defaultValue="")
protected String excludeArtifactIds
Comma separated list of Artifact names to exclude.

Since:
2.0

includeArtifactIds

@Parameter(property="includeArtifactIds",
           defaultValue="")
protected String includeArtifactIds
Comma separated list of Artifact names to include.

Since:
2.0

excludeGroupIds

@Parameter(property="excludeGroupIds",
           defaultValue="")
protected String excludeGroupIds
Comma separated list of GroupId Names to exclude.

Since:
2.0

includeGroupIds

@Parameter(property="includeGroupIds",
           defaultValue="")
protected String includeGroupIds
Comma separated list of GroupIds to include.

Since:
2.0

markersDirectory

@Parameter(property="markersDirectory",
           defaultValue="${project.build.directory}/dependency-maven-plugin-markers")
protected File markersDirectory
Directory to store flag files

Since:
2.0

prependGroupId

@Parameter(property="mdep.prependGroupId",
           defaultValue="false")
protected boolean prependGroupId
Prepend the groupId during copy.

Since:
2.2
Constructor Detail

AbstractDependencyFilterMojo

public AbstractDependencyFilterMojo()
Method Detail

getMarkedArtifactFilter

protected abstract ArtifactsFilter getMarkedArtifactFilter()
Return an ArtifactsFilter indicating which artifacts must be filtered out.

Returns:
an ArtifactsFilter indicating which artifacts must be filtered out.

getResolvedDependencies

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

Returns:
A HashSet of artifacts
Throws:
MojoExecutionException

getDependencySets

protected DependencyStatusSets getDependencySets(boolean stopOnFailure)
                                          throws MojoExecutionException
Throws:
MojoExecutionException

getDependencySets

protected DependencyStatusSets getDependencySets(boolean stopOnFailure,
                                                 boolean includeParents)
                                          throws 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:
MojoExecutionException

getClassifierTranslatedDependencies

protected DependencyStatusSets getClassifierTranslatedDependencies(Set<Artifact> artifacts,
                                                                   boolean stopOnFailure)
                                                            throws MojoExecutionException
Transform artifacts

Parameters:
artifacts -
stopOnFailure -
Returns:
DependencyStatusSets - Bean of TreeSets that contains information on the projects dependencies
Throws:
MojoExecutionException

filterMarkedDependencies

protected DependencyStatusSets filterMarkedDependencies(Set<Artifact> artifacts)
                                                 throws MojoExecutionException
Filter the marked dependencies

Parameters:
artifacts -
Returns:
Throws:
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-2013 The Apache Software Foundation. All Rights Reserved.