Test if project version is a snapshot

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@344173 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2005-11-14 18:05:45 +00:00
parent 62a19fa56e
commit 21f01fb81a
1 changed files with 5 additions and 0 deletions

View File

@ -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 )