[MNG-5096] <exclusion> on <dependency> with <type>test-jar</type> doesn't work in maven 3

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1151423 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2011-07-27 10:45:43 +00:00
parent 5c79de69e7
commit 4be95217be
1 changed files with 13 additions and 1 deletions

View File

@ -36,6 +36,7 @@ import org.codehaus.plexus.logging.Logger;
import org.sonatype.aether.RepositorySystem;
import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.RequestTrace;
import org.sonatype.aether.artifact.ArtifactType;
import org.sonatype.aether.artifact.ArtifactTypeRegistry;
import org.sonatype.aether.collection.CollectRequest;
import org.sonatype.aether.collection.DependencyCollectionException;
@ -92,7 +93,18 @@ public class DefaultProjectDependenciesResolver
Map<String, Dependency> dependencies = new HashMap<String, Dependency>();
for ( Dependency dependency : project.getDependencies() )
{
String key = dependency.getManagementKey();
String classifier = dependency.getClassifier();
if ( classifier == null )
{
ArtifactType type = stereotypes.get( dependency.getType() );
if ( type != null )
{
classifier = type.getClassifier();
}
}
String key =
ArtifacIdUtils.toVersionlessId( dependency.getGroupId(), dependency.getArtifactId(),
dependency.getType(), classifier );
dependencies.put( key, dependency );
}
for ( Artifact artifact : project.getDependencyArtifacts() )