[ http://jira.codehaus.org/browse/MDEP-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=202672#action_202672 ]
Richard Allen edited comment on MDEP-193 at 12/15/09 6:51 AM: -------------------------------------------------------------- This also affects maven-dependency-plugin version 2.1, unfortunately making {{<excludeClassifiers>}} useless. I found that this bug has been fixed in {{org.apache.maven.shared:maven-common-artifact-filters:1.2}}, see: [AbstractArtifactFeatureFilter.java|http://svn.apache.org/viewvc/maven/shared/tags/maven-common-artifact-filters-1.2/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilter.java?view=markup] I tested to ensure this fixed the problem by doing the following: # Downloaded the source for maven-dependency-plugin version 2.1 # Changed the maven-common-artifact-filters dependency to version 1.2 # Changed references to {{org.apache.maven.shared.artifact.filter.collection.TransitivityFilter}} to {{org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter}} (the name changed) # Locally installed the plugin and used it with {{<excludeClassifiers>}} was (Author: richard.allen): This also affects maven-dependency-plugin version 2.1, unfortunately making {{<excludeClassifiers>}} useless. I found that this bug has been fixed in {{org.apache.maven.shared:maven-common-artifact-filters:1.2}}, see: [AbstractArtifactFeatureFilter.java|http://svn.apache.org/viewvc/maven/shared/tags/maven-common-artifact-filters-1.2/src/main/java/org/apache/maven/shared/artifact/filter/collection/AbstractArtifactFeatureFilter.java?view=markup] I tested to ensure this fixed the problem by doing to following: # Downloaded the source for maven-dependency-plugin version 2.1 # Changed the maven-common-artifact-filters dependency to version 1.2 # Changed references to {{org.apache.maven.shared.artifact.filter.collection.TransitivityFilter}} to {{org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter}} (the name changed) # Locally installed the plugin and used it with {{<excludeClassifiers>}} > NullPointerException inside > org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter > ------------------------------------------------------------------------------------------------------------ > > Key: MDEP-193 > URL: http://jira.codehaus.org/browse/MDEP-193 > Project: Maven 2.x Dependency Plugin > Issue Type: Bug > Affects Versions: 2.0 > Reporter: Sascha Hofer > > when using the profile shown below AbstractArtifactFeatureFilter (concrete > class: org.apache.maven.shared.artifact.filter.collection.ClassifierFilter) > encounters a NullPointerException when comparing an artifacts classifier with > one of the exclusion list. > This NPE happens because there are artifacts which simple have no classifier > and AbstractArtifactFeatureFilter.compareFeatures(String, String) simply > invokes <left string>.equals(<right string>). > In addition to this the stated NPE must already have been occured some time > ago because in > org.apache.maven.shared.artifact.filter.collection.FilterArtifacts.filter(Set) > it gets catched and ignored. > proposed fix in > org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter: > /** > * Allows Feature comparison to be customized > * > * @param lhs String artifact's feature > * @param rhs String feature from exclude or include list > * @return boolean true if features match > */ > protected boolean compareFeatures( String lhs, String rhs ) > { > if (lhs == null) > { > return rhs == null; > } > else > { > return ( lhs.equals( rhs ) ); > } > } > part of the pom.xml which caused the error: > <profile> > <id>multi-module-coverage</id> > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-dependency-plugin</artifactId> > <executions> > <execution> > <id>unpack-dependencies</id> > <phase>process-classes</phase> > <goals> > <goal>unpack-dependencies</goal> > </goals> > <configuration> > > <outputDirectory>${project.build.directory}/classes</outputDirectory> > <excludeClassifiers>tests</excludeClassifiers> > </configuration> > </execution> > </executions> > </plugin> > </plugins> > </build> > </profile> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira