public ReleaseResult execute( ReleaseDescriptor releaseDescriptor,
ReleaseEnvironment releaseEnvironment,
List<MavenProject> reactorProjects )
throws ReleaseExecutionException, ReleaseFailureException
{
ReleaseResult result = new ReleaseResult();
// if we stopped mid-way through preparation - don't perform
if ( releaseDescriptor.getCompletedPhase() != null
&& !"end-release".equals( releaseDescriptor.getCompletedPhase() ) )
{
String message = "Cannot perform release - the preparation step was stopped mid-way. Please re-run "
+ "release:prepare to continue, or perform the release from an SCM tag.";
result.setResultCode( ReleaseResult.ERROR );
logError( result, message );
throw new ReleaseFailureException( message );
}
if ( releaseDescriptor.getScmSourceUrl() == null )
{
String message = "No SCM URL was provided to perform the release from";
result.setResultCode( ReleaseResult.ERROR );
logError( result, message );
throw new ReleaseFailureException( message );
}
result.setResultCode( ReleaseResult.SUCCESS );
return result;
}