diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java index 692408b4b6..5ebf110c17 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java @@ -81,7 +81,7 @@ public abstract class AbstractMavenIntegrationTestCase ArtifactVersion version = getMavenVersion(); if ( version != null ) { - skip = !versionRange.containsVersion( version ); + skip = !versionRange.containsVersion( removeSnapshot( version ) ); } else { @@ -129,7 +129,7 @@ public abstract class AbstractMavenIntegrationTestCase ArtifactVersion version = getMavenVersion(); if ( version != null ) { - return versionRange.containsVersion( version ); + return versionRange.containsVersion( removeSnapshot( version ) ); } else { @@ -225,4 +225,14 @@ public abstract class AbstractMavenIntegrationTestCase return localRepo; } + + private static ArtifactVersion removeSnapshot( ArtifactVersion version ) + { + String v = version.toString(); + if ( v.endsWith( "-SNAPSHOT" ) ) + { + return new DefaultArtifactVersion( v.substring( 0, v.length() - 9 ) ); + } + return version; + } }