Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 2.0.2
-
Fix Version/s: None
-
Component/s: Dependencies
-
Labels:None
-
Complexity:Intermediate
Description
I thing, I found an error in dependency exclusions calculations.
For pom dependencies:
<dependencies>
<dependency>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
<version>1.2.8</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>gnujaxp</groupId>
<artifactId>gnujaxp</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
in method MavenMetadataSource.createArtifacts the two above dependencies are processed and ArtifactFilters are applied. The first dependency (struts) gets ExcludesArtifactFilter( "javax.servlet:servlet-api" ) - this is OK, but
the second dependency (jfreechart) gets wrong filter - AndArtifactFilter which concatenates ExcludesArtifactFilter( "gnujaxp:gnujaxp" ) with ExcludesArtifactFilter( "javax.servlet:servlet-api" ). This second ExcludesArtifactFilter comes from the first dependency (struts). Method parameter "dependencyFilter" is overridden when processing the first dependency and read when processing the second one. The fix should be simple.
Issue Links
- duplicates
-
MNG-1797
Dependency excludes apply to every subsequent dependency, not just the one it is declared under.
-
Sholud be Maven 2.0.2, not 2.0.1