From 4be95217be6ef2890a34c6822e4d983a4eb8c772 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Wed, 27 Jul 2011 10:45:43 +0000 Subject: [PATCH] [MNG-5096] on with test-jar 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 --- .../DefaultProjectDependenciesResolver.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java index 11f9846a8e..2c3ca3b7e1 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java @@ -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 dependencies = new HashMap(); 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() )