maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r594593 - /maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Date Tue, 13 Nov 2007 17:45:07 GMT
Author: brett
Date: Tue Nov 13 09:45:06 2007
New Revision: 594593

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

Modified:
    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

Modified: maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=594593&r1=594592&r2=594593&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
(original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Tue Nov 13 09:45:06 2007
@@ -29,6 +29,7 @@
 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.plugin.AbstractMojo;
@@ -531,7 +532,7 @@
             if ( testNgArtifact != null )
             {
                 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