maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r594594 - /maven/surefire/branches/surefire-2.3.x/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Date Tue, 13 Nov 2007 17:49:59 GMT
Author: brett
Date: Tue Nov 13 09:49:56 2007
New Revision: 594594

URL: http://svn.apache.org/viewvc?rev=594594&view=rev
Log:
i[SUREFIRE-360] maven-surefire-plugin fails with an NPE when test ng is configured transitively
Submitted by: Tibor Varga
Merged from trunk rev: 594593

Modified:
    maven/surefire/branches/surefire-2.3.x/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

Modified: maven/surefire/branches/surefire-2.3.x/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: http://svn.apache.org/viewvc/maven/surefire/branches/surefire-2.3.x/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=594594&r1=594593&r2=594594&view=diff
==============================================================================
--- maven/surefire/branches/surefire-2.3.x/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
(original)
+++ maven/surefire/branches/surefire-2.3.x/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Tue Nov 13 09:49:56 2007
@@ -29,8 +29,10 @@
 import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
@@ -502,7 +504,7 @@
                 addArtifact( surefireBooter, testNgArtifact );
 
                 VersionRange range = VersionRange.createFromVersionSpec( "[4.7,)" );
-                if ( !range.containsVersion( testNgArtifact.getSelectedVersion() ) )
+                if ( !range.containsVersion( new DefaultArtifactVersion(testNgArtifact.getVersion())
) )
                 {
                     throw new MojoFailureException(
                                                     "TestNG support requires version 4.7
or above. You have declared version " +



Mime
View raw message