releaseVersionInfo = 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 );
}
}
if ( nextSnapshotVersionInfo == null )
{
nextSnapshotVersionInfo = releaseVersionInfo.getNextVersion();
}
}
else
{
// cannot proceed without a next value in batch mode
throw new ReleaseExecutionException( msg, e );
}
}
try
{
if ( convertToSnapshot )
{
if ( releaseDescriptor.isBranchCreation() )
{
if ( convertToBranch )
{
// branch modification
if ( releaseDescriptor.isUpdateBranchVersions()
&& ( ArtifactUtils.isSnapshot( project.getVersion() ) || releaseDescriptor.isUpdateVersionsToSnapshot() ) )
{
nextVersion = releaseVersionInfo.getSnapshotVersionString();
if ( !releaseVersionIsExplicit && releaseDescriptor.isInteractive() )
{
nextVersion = prompter.prompt(
"What is the branch version for \"" + project.getName() + "\"? (" + projectId + ")",
nextVersion );
}
}
else
{
nextVersion = project.getVersion();
}
}
else
{
// working copy modification
if ( ArtifactUtils.isSnapshot( project.getVersion() )
&& releaseDescriptor.isUpdateWorkingCopyVersions() )
{
nextVersion = nextSnapshotVersionInfo.getSnapshotVersionString();
if ( releaseDescriptor.isInteractive() && !nextSnapshotVersionIsExplicit )
{
nextVersion =
prompter.prompt( "What is the new working copy version for \"" + project.getName()
+ "\"? (" + projectId + ")", nextVersion );
}
}
else
{
nextVersion = project.getVersion();
}
}
}
else
{
nextVersion = nextSnapshotVersionInfo.getSnapshotVersionString();
if ( releaseDescriptor.isInteractive() && !nextSnapshotVersionIsExplicit )
{
nextVersion =
prompter.prompt( "What is the new development version for \"" + project.getName() + "\"? ("
+ projectId + ")", nextVersion );
}
}
}
else
{
if ( ArtifactUtils.isSnapshot( project.getVersion() ) )
{
nextVersion = releaseVersionInfo.getReleaseVersionString();
if ( releaseDescriptor.isInteractive() && !releaseVersionIsExplicit )
{
nextVersion = prompter.prompt(
"What is the release version for \"" + project.getName() + "\"? (" + projectId + ")",
nextVersion );
}
}
else
{
nextVersion = project.getVersion();
}
}
}
catch ( PrompterException e )
{
throw new ReleaseExecutionException( "Error reading version from input handler: " + e.getMessage(), e );
}
return nextVersion;
}