Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
In the class org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter, the filter should only include items that are part of the direct dependencies. However, the method that does this check (artifactIsADirectDependency) only verifies that a dependency has the same artifactId and groupId as a direct dependency. It should also check the classifier and type. I've included an updated version of the method below:
public boolean artifactIsADirectDependency( Artifact artifact ) { boolean result = false; Iterator iterator = this.directDependencies.iterator(); while ( iterator.hasNext() ) { Artifact dependency = (Artifact) iterator.next(); if ( dependency.getGroupId().equals( artifact.getGroupId() ) && dependency.getArtifactId().equals( artifact.getArtifactId() ) && dependency.getClassifier().equals( artifact.getClassifier() ) && dependency.getType().equals( artifact.getType() ) ) { result = true; break; } } return result; }