catch ( NoSuchScmProviderException e )
{
throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
}
BranchScmResult result;
try
{
ScmFileSet fileSet = new ScmFileSet( new File( basedirAlignedReleaseDescriptor.getWorkingDirectory() ) );
String branchName = releaseDescriptor.getScmReleaseLabel();
ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
scmBranchParameters.setMessage( releaseDescriptor.getScmCommentPrefix() + " copy for branch " + branchName );
scmBranchParameters.setRemoteBranching( releaseDescriptor.isRemoteTagging() );
scmBranchParameters.setScmRevision( releaseDescriptor.getScmReleasedPomRevision() );
result = provider.branch( repository, fileSet, branchName, scmBranchParameters );
}
catch ( ScmException e )
{
throw new ReleaseExecutionException( "An error is occurred in the branch process: " + e.getMessage(), e );
}
if ( !result.isSuccess() )
{
throw new ReleaseScmCommandException( "Unable to branch SCM", result );
}
relResult.setResultCode( ReleaseResult.SUCCESS );