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 ); } }