for ( Plugin plugin : (List<Plugin>) model.getBuild().getPlugins() )
{
if ( plugin.getGroupId() != null && plugin.getGroupId().equals( "org.apache.maven.plugins" ) &&
plugin.getArtifactId() != null && plugin.getArtifactId().equals( "maven-release-plugin" ) )
{
Xpp3Dom dom = (Xpp3Dom) plugin.getConfiguration();
if ( dom != null )
{
Xpp3Dom configuration = dom.getChild( "releaseLabel" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_SCM_TAG, configuration.getValue() );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_SCM_TAG, "" );
}
configuration = dom.getChild( "tag" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_SCM_TAG, configuration.getValue() );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_SCM_TAG, "" );
}
configuration = dom.getChild( "tagBase" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_SCM_TAGBASE,
configuration.getValue() );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_SCM_TAGBASE, "" );
}
configuration = dom.getChild( "preparationGoals" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_PREPARE_GOALS,
configuration.getValue() );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_PREPARE_GOALS, "" );
}
configuration = dom.getChild( "arguments" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_ARGUMENTS,
configuration.getValue() );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_ARGUMENTS, "" );
}
configuration = dom.getChild( "scmCommentPrefix" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_SCM_COMMENT_PREFIX,
configuration.getValue() );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_SCM_COMMENT_PREFIX, "" );
}
configuration = dom.getChild( "autoVersionSubmodules" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_AUTO_VERSION_SUBMODULES,
Boolean.valueOf( configuration.getValue() ) );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_AUTO_VERSION_SUBMODULES, false );
}
configuration = dom.getChild( "addSchema" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_ADD_SCHEMA,
Boolean.valueOf( configuration.getValue() ) );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_ADD_SCHEMA, false );
}
configuration = dom.getChild( "useReleaseProfile" );
if ( configuration != null )
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_USE_RELEASE_PROFILE,
Boolean.valueOf( configuration.getValue() ) );
}
else
{
releaseParameters.put( ContinuumBuildAgentUtil.KEY_USE_RELEASE_PROFILE, false );
}
configuration = dom.getChild( "goals" );
if ( configuration != null )
{
String goals = configuration.getValue();
if ( model.getDistributionManagement() != null &&
model.getDistributionManagement().getSite() != null )
{
goals += "site-deploy";
}