private ReleaseDescriptor getReleaseDescriptor( Project project, Properties releaseProperties,
Map<String, String> relVersions, Map<String, String> devVersions,
Map<String, String> environments, String workingDirectory,
String executable )
{
ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
//release properties from the project
descriptor.setWorkingDirectory( workingDirectory );
descriptor.setScmSourceUrl( project.getScmUrl() );
//required properties
descriptor.setScmReleaseLabel( releaseProperties.getProperty( "tag" ) );
descriptor.setScmTagBase( releaseProperties.getProperty( "tagBase" ) );
descriptor.setReleaseVersions( relVersions );
descriptor.setDevelopmentVersions( devVersions );
descriptor.setPreparationGoals( releaseProperties.getProperty( "prepareGoals" ) );
descriptor.setAdditionalArguments( releaseProperties.getProperty( "arguments" ) );
descriptor.setAddSchema( Boolean.valueOf( releaseProperties.getProperty( "addSchema" ) ) );
descriptor.setAutoVersionSubmodules(
Boolean.valueOf( releaseProperties.getProperty( "autoVersionSubmodules" ) ) );
String useEditMode = releaseProperties.getProperty( "useEditMode" );
if ( BooleanUtils.toBoolean( useEditMode ) )
{
descriptor.setScmUseEditMode( Boolean.valueOf( useEditMode ) );
}
LocalRepository repository = project.getProjectGroup().getLocalRepository();
if ( repository != null )
{
String args = descriptor.getAdditionalArguments();
if ( StringUtils.isNotEmpty( args ) )
{
descriptor.setAdditionalArguments( args +
" \"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
}
else
{
descriptor.setAdditionalArguments( "\"-Dmaven.repo.local=" + repository.getLocation() + "\"" );
}
}
//other properties
if ( releaseProperties.containsKey( "username" ) )
{
descriptor.setScmUsername( releaseProperties.getProperty( "username" ) );
}
if ( releaseProperties.containsKey( "password" ) )
{
descriptor.setScmPassword( releaseProperties.getProperty( "password" ) );
}
if ( releaseProperties.containsKey( "commentPrefix" ) )
{
descriptor.setScmCommentPrefix( releaseProperties.getProperty( "commentPrefix" ) );
}
if ( releaseProperties.containsKey( "useReleaseProfile" ) )
{
descriptor.setUseReleaseProfile( Boolean.valueOf( releaseProperties.getProperty( "useReleaseProfile" ) ) );
}
//forced properties
descriptor.setInteractive( false );
//set environments
descriptor.setEnvironments( environments );
descriptor.setExecutable( executable );
return descriptor;
}