throws MojoExecutionException
{
List<MavenProject> projects = new ArrayList<MavenProject>();
// add filters in well known order, least specific to most specific
FilterArtifacts filter = new FilterArtifacts();
Set<Artifact> artifacts = resolveProjectArtifacts();
if ( this.excludeTransitive )
{
Set<Artifact> depArtifacts;
if ( runOnlyAtExecutionRoot )
{
depArtifacts = aggregateProjectDependencyArtifacts();
}
else
{
depArtifacts = project.getDependencyArtifacts();
}
filter.addFilter( new ProjectTransitivityFilter( depArtifacts, true ) );
}
filter.addFilter( new ScopeFilter( this.includeScope, this.excludeScope ) );
filter.addFilter( new GroupIdFilter( this.includeGroupIds, this.excludeGroupIds ) );
filter.addFilter( new ArtifactIdFilter( this.includeArtifactIds, this.excludeArtifactIds ) );
// perform filtering
try
{
artifacts = filter.filter( artifacts );
}
catch ( ArtifactFilterException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}