protected DependencyStatusSets getClassifierTranslatedDependencies( Set<Artifact> artifacts, boolean stopOnFailure )
throws MojoExecutionException
{
Set<Artifact> unResolvedArtifacts = new HashSet<Artifact>();
Set<Artifact> resolvedArtifacts = artifacts;
DependencyStatusSets status = new DependencyStatusSets();
// possibly translate artifacts into a new set of artifacts based on the
// classifier and type
// if this did something, we need to resolve the new artifacts
if ( StringUtils.isNotEmpty( classifier ) )
{
ArtifactTranslator translator = new ClassifierTypeTranslator( this.classifier, this.type, this.factory );
artifacts = translator.translate( artifacts, getLog() );
status = filterMarkedDependencies( artifacts );
// the unskipped artifacts are in the resolved set.
artifacts = status.getResolvedDependencies();
// resolve the rest of the artifacts
ArtifactsResolver artifactsResolver =
new DefaultArtifactsResolver( this.resolver, this.getLocal(), this.remoteRepos, stopOnFailure );
resolvedArtifacts = artifactsResolver.resolve( artifacts, getLog() );
// calculate the artifacts not resolved.
unResolvedArtifacts.addAll( artifacts );
unResolvedArtifacts.removeAll( resolvedArtifacts );
}
// return a bean of all 3 sets.
status.setResolvedDependencies( resolvedArtifacts );
status.setUnResolvedDependencies( unResolvedArtifacts );
return status;
}