*/
protected DependencyStatusSets getDependencySets( boolean stopOnFailure, boolean includeParents )
throws MojoExecutionException
{
// add filters in well known order, least specific to most specific
FilterArtifacts filter = new FilterArtifacts();
filter.addFilter( new ProjectTransitivityFilter( project.getDependencyArtifacts(), this.excludeTransitive ) );
filter.addFilter( new ScopeFilter( DependencyUtil.cleanToBeTokenizedString( this.includeScope ),
DependencyUtil.cleanToBeTokenizedString( this.excludeScope ) ) );
filter.addFilter( new TypeFilter( DependencyUtil.cleanToBeTokenizedString( this.includeTypes ),
DependencyUtil.cleanToBeTokenizedString( this.excludeTypes ) ) );
filter.addFilter( new ClassifierFilter( DependencyUtil.cleanToBeTokenizedString( this.includeClassifiers ),
DependencyUtil.cleanToBeTokenizedString( this.excludeClassifiers ) ) );
filter.addFilter( new GroupIdFilter( DependencyUtil.cleanToBeTokenizedString( this.includeGroupIds ),
DependencyUtil.cleanToBeTokenizedString( this.excludeGroupIds ) ) );
filter.addFilter( new ArtifactIdFilter( DependencyUtil.cleanToBeTokenizedString( this.includeArtifactIds ),
DependencyUtil.cleanToBeTokenizedString( this.excludeArtifactIds ) ) );
// start with all artifacts.
@SuppressWarnings( "unchecked" ) Set<Artifact> artifacts = project.getArtifacts();
if ( includeParents )
{
// add dependencies parents
for ( Artifact dep : new ArrayList<Artifact>( artifacts ) )
{
addParentArtifacts( buildProjectFromArtifact( dep ), artifacts );
}
// add current project parent
addParentArtifacts( project, artifacts );
}
// perform filtering
try
{
artifacts = filter.filter( artifacts );
}
catch ( ArtifactFilterException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}