From be6ec8844eb380d58f0b64e11f9fb4b8836e7295 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Tue, 16 Jun 2009 20:07:34 +0000 Subject: [PATCH] [MNG-4203] [regression] Dependency exclusions are not applied transitively git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@785362 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/project/artifact/MavenMetadataSource.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java index a06a70f950..7583fc6f74 100644 --- a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java +++ b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java @@ -176,6 +176,8 @@ public class MavenMetadataSource dependencyArtifact.setFile( new File( d.getSystemPath() ) ); } + ArtifactFilter newFilter = dependencyFilter; + if ( !d.getExclusions().isEmpty() ) { List exclusions = new ArrayList(); @@ -185,14 +187,15 @@ public class MavenMetadataSource exclusions.add( e.getGroupId() + ":" + e.getArtifactId() ); } - ArtifactFilter newFilter = new ExcludesArtifactFilter( exclusions ); + newFilter = new ExcludesArtifactFilter( exclusions ); if ( dependencyFilter != null ) { newFilter = new AndArtifactFilter( Arrays.asList( dependencyFilter, newFilter ) ); } - dependencyArtifact.setDependencyFilter( newFilter ); } + dependencyArtifact.setDependencyFilter( newFilter ); + artifacts.add( dependencyArtifact ); } }