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( "scm-tag" ) );
descriptor.setScmTagBase( releaseProperties.getProperty( "scm-tagbase" ) );
descriptor.setReleaseVersions( relVersions );
descriptor.setDevelopmentVersions( devVersions );
descriptor.setPreparationGoals( releaseProperties.getProperty( "preparation-goals" ) );
descriptor.setAdditionalArguments( releaseProperties.getProperty( "arguments" ) );
descriptor.setAddSchema( Boolean.valueOf( releaseProperties.getProperty( "add-schema" ) ) );
descriptor.setAutoVersionSubmodules( Boolean.valueOf( releaseProperties.getProperty(
"auto-version-submodules" ) ) );
String useEditMode = releaseProperties.getProperty( "use-edit-mode" );
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( "scm-username" ) )
{
descriptor.setScmUsername( releaseProperties.getProperty( "scm-username" ) );
}
if ( releaseProperties.containsKey( "scm-password" ) )
{
descriptor.setScmPassword( releaseProperties.getProperty( "scm-password" ) );
}
if ( releaseProperties.containsKey( "scm-comment-prefix" ) )
{
descriptor.setScmCommentPrefix( releaseProperties.getProperty( "scm-comment-prefix" ) );
}
if ( releaseProperties.containsKey( "use-release-profile" ) )
{
descriptor.setUseReleaseProfile( Boolean.valueOf( releaseProperties.getProperty(
"use-release-profile" ) ) );
}
//forced properties
descriptor.setInteractive( false );
//set environments
descriptor.setEnvironments( environments );
descriptor.setExecutable( executable );
//release by
descriptor.setReleaseBy( releaseProperties.getProperty( "release-by" ) );
return descriptor;
}