diff --git a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java index 9929b86383..282a0c8a79 100644 --- a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java +++ b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectVersionResolver.java @@ -58,6 +58,11 @@ public class ProjectVersionResolver //Rewrite project version String projectVersion = model.getVersion(); + if ( !projectVersion.endsWith( SNAPSHOT_CLASSIFIER ) ) + { + throw new IllegalArgumentException( "Project version isn't a snapshot, it must ends with '" + SNAPSHOT_CLASSIFIER + "'." ); + } + projectVersion = projectVersion.substring( 0, projectVersion.length() - SNAPSHOT_CLASSIFIER.length() ); if ( interactive )