{
while ( nextVersion == null || ArtifactUtils.isSnapshot( nextVersion ) != convertToSnapshot )
{
if ( suggestedVersion == null )
{
DefaultVersionInfo versionInfo;
try
{
String baseVersion = null;
if ( convertToSnapshot )
{
baseVersion = getReleaseVersion( projectId, releaseDescriptor );
}
// unspecified and unmapped version, so use project version
if ( baseVersion == null )
{
baseVersion = project.getVersion();
}
versionInfo = new DefaultVersionInfo( baseVersion );
}
catch ( VersionParseException e )
{
if ( releaseDescriptor.isInteractive() )
{
try
{
versionInfo = new DefaultVersionInfo( "1.0" );
}
catch ( VersionParseException e1 )
{
// if that happens we are in serious trouble!
throw new ReleaseExecutionException( "Version 1.0 could not be parsed!", e1 );
}
}
else
{
throw new ReleaseExecutionException(
"Error parsing version, cannot determine next version: "
+ e.getMessage(), e );
}
}
suggestedVersion =
convertToSnapshot ? versionInfo.getNextVersion().getSnapshotVersionString()
: versionInfo.getReleaseVersionString();
}
if ( releaseDescriptor.isInteractive() )
{
if ( messageKey == null )