You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Sascha Hofer (JIRA)" <ji...@codehaus.org> on 2008/10/16 08:57:19 UTC
[jira] Created: (MNG-3791) NullPointerException inside
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
NullPointerException inside org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
------------------------------------------------------------------------------------------------------------
Key: MNG-3791
URL: http://jira.codehaus.org/browse/MNG-3791
Project: Maven 2
Issue Type: Bug
Affects Versions: 2.0.8
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
[jira] Issue Comment Edited: (MDEP-193) NullPointerException inside
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
Posted by "Richard Allen (JIRA)" <ji...@codehaus.org>.
[ 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
[jira] Reopened: (MDEP-193) NullPointerException inside
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
Posted by "Dan Tran (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MDEP-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Tran reopened MDEP-193:
---------------------------
> 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.2
>
>
> 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
[jira] Closed: (MDEP-193) NullPointerException inside
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
Posted by "Dan Tran (JIRA)" <ji...@codehaus.org>.
[ 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: (was: 2.1)
2.2
> 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.2
>
>
> 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
[jira] Moved: (MDEP-193) NullPointerException inside
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MDEP-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter moved MNG-3791 to MDEP-193:
----------------------------------------
Affects Version/s: (was: 2.0.8)
2.0
Key: MDEP-193 (was: MNG-3791)
Project: Maven 2.x Dependency Plugin (was: Maven 2)
> 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
[jira] Commented: (MDEP-193) NullPointerException inside
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
Posted by "Richard Allen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MDEP-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=202672#action_202672 ]
Richard Allen commented on MDEP-193:
------------------------------------
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
[jira] Closed: (MDEP-193) NullPointerException inside
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
Posted by "Dan Tran (JIRA)" <ji...@codehaus.org>.
[ 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