[ http://jira.codehaus.org/browse/MDEP-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dan Tran closed MDEP-193.
-------------------------
Resolution: Fixed
Fix Version/s: 2.1
Assignee: Dan Tran
fixed per suggestion
Revision: 894979
Author: dantran
Date: 12:33:29 AM, Friday, January 01, 2010
Message:
[MDEP-193] use maven-common-artifact-filters-1.2 to excludeClassifers and includesClassifers
to work. IT added
----
Modified : /maven/plugins/trunk/maven-dependency-plugin/pom.xml
Modified : /maven/plugins/trunk/maven-dependency-plugin/src/it/copy-dependencies/pom.xml
Modified : /maven/plugins/trunk/maven-dependency-plugin/src/it/copy-dependencies/validate.bsh
Modified : /maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
> 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
> Assignee: Dan Tran
> Fix For: 2.1
>
>
> 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
|