mirror of https://github.com/apache/maven.git
[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:
parent
5c79de69e7
commit
4be95217be
|
@ -36,6 +36,7 @@ import org.codehaus.plexus.logging.Logger;
|
||||||
import org.sonatype.aether.RepositorySystem;
|
import org.sonatype.aether.RepositorySystem;
|
||||||
import org.sonatype.aether.RepositorySystemSession;
|
import org.sonatype.aether.RepositorySystemSession;
|
||||||
import org.sonatype.aether.RequestTrace;
|
import org.sonatype.aether.RequestTrace;
|
||||||
|
import org.sonatype.aether.artifact.ArtifactType;
|
||||||
import org.sonatype.aether.artifact.ArtifactTypeRegistry;
|
import org.sonatype.aether.artifact.ArtifactTypeRegistry;
|
||||||
import org.sonatype.aether.collection.CollectRequest;
|
import org.sonatype.aether.collection.CollectRequest;
|
||||||
import org.sonatype.aether.collection.DependencyCollectionException;
|
import org.sonatype.aether.collection.DependencyCollectionException;
|
||||||
|
@ -92,7 +93,18 @@ public class DefaultProjectDependenciesResolver
|
||||||
Map<String, Dependency> dependencies = new HashMap<String, Dependency>();
|
Map<String, Dependency> dependencies = new HashMap<String, Dependency>();
|
||||||
for ( Dependency dependency : project.getDependencies() )
|
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 );
|
dependencies.put( key, dependency );
|
||||||
}
|
}
|
||||||
for ( Artifact artifact : project.getDependencyArtifacts() )
|
for ( Artifact artifact : project.getDependencyArtifacts() )
|
||||||
|
|
Loading…
Reference in New Issue