mojo.setGoal( c.getChild( "goal" ).getValue() );
mojo.setImplementation( c.getChild( "implementation" ).getValue() );
PlexusConfiguration langConfig = c.getChild( "language" );
if ( langConfig != null )
{
mojo.setLanguage( langConfig.getValue() );
}
PlexusConfiguration configuratorConfig = c.getChild( "configurator" );
if ( configuratorConfig != null )
{
mojo.setComponentConfigurator( configuratorConfig.getValue() );
}
PlexusConfiguration composerConfig = c.getChild( "composer" );
if ( composerConfig != null )
{
mojo.setComponentComposer( composerConfig.getValue() );
}
String since = c.getChild( "since" ).getValue();
if ( since != null )
{
mojo.setSince( since );
}
PlexusConfiguration deprecated = c.getChild( "deprecated", false );
if ( deprecated != null )
{
mojo.setDeprecated( deprecated.getValue() );
}
String phase = c.getChild( "phase" ).getValue();
if ( phase != null )
{
mojo.setPhase( phase );
}
String executePhase = c.getChild( "executePhase" ).getValue();
if ( executePhase != null )
{
mojo.setExecutePhase( executePhase );
}
String executeMojo = c.getChild( "executeGoal" ).getValue();
if ( executeMojo != null )
{
mojo.setExecuteGoal( executeMojo );
}
String executeLifecycle = c.getChild( "executeLifecycle" ).getValue();
if ( executeLifecycle != null )
{
mojo.setExecuteLifecycle( executeLifecycle );
}
mojo.setInstantiationStrategy( c.getChild( "instantiationStrategy" ).getValue() );
mojo.setDescription( c.getChild( "description" ).getValue() );
PlexusConfiguration dependencyResolution = c.getChild( "requiresDependencyResolution", false );
if ( dependencyResolution != null )
{
mojo.setDependencyResolutionRequired( dependencyResolution.getValue() );
}
PlexusConfiguration dependencyCollection = c.getChild( "requiresDependencyCollection", false );
if ( dependencyCollection != null )
{
mojo.setDependencyCollectionRequired( dependencyCollection.getValue() );
}
String directInvocationOnly = c.getChild( "requiresDirectInvocation" ).getValue();
if ( directInvocationOnly != null )
{
mojo.setDirectInvocationOnly( Boolean.parseBoolean( directInvocationOnly ) );
}
String requiresProject = c.getChild( "requiresProject" ).getValue();
if ( requiresProject != null )
{
mojo.setProjectRequired( Boolean.parseBoolean( requiresProject ) );
}
String requiresReports = c.getChild( "requiresReports" ).getValue();
if ( requiresReports != null )
{
mojo.setRequiresReports( Boolean.parseBoolean( requiresReports ) );
}
String aggregator = c.getChild( "aggregator" ).getValue();
if ( aggregator != null )
{
mojo.setAggregator( Boolean.parseBoolean( aggregator ) );
}
String requiresOnline = c.getChild( "requiresOnline" ).getValue();
if ( requiresOnline != null )
{
mojo.setOnlineRequired( Boolean.parseBoolean( requiresOnline ) );
}
String inheritedByDefault = c.getChild( "inheritedByDefault" ).getValue();
if ( inheritedByDefault != null )
{
mojo.setInheritedByDefault( Boolean.parseBoolean( inheritedByDefault ) );
}
String threadSafe = c.getChild( "threadSafe" ).getValue();
if ( threadSafe != null )
{
mojo.setThreadSafe( Boolean.parseBoolean( threadSafe ) );
}
// ----------------------------------------------------------------------
// Configuration
// ----------------------------------------------------------------------
PlexusConfiguration mojoConfig = c.getChild( "configuration" );
mojo.setMojoConfiguration( mojoConfig );
// ----------------------------------------------------------------------
// Parameters
// ----------------------------------------------------------------------
PlexusConfiguration[] parameterConfigurations = c.getChild( "parameters" ).getChildren( "parameter" );
List<Parameter> parameters = new ArrayList<Parameter>();
for ( PlexusConfiguration d : parameterConfigurations )
{
Parameter parameter = new Parameter();
parameter.setName( d.getChild( "name" ).getValue() );
parameter.setAlias( d.getChild( "alias" ).getValue() );
parameter.setType( d.getChild( "type" ).getValue() );
String required = d.getChild( "required" ).getValue();
parameter.setRequired( Boolean.parseBoolean( required ) );
PlexusConfiguration editableConfig = d.getChild( "editable" );
// we need the null check for pre-build legacy plugins...
if ( editableConfig != null )
{
String editable = d.getChild( "editable" ).getValue();
parameter.setEditable( editable == null || Boolean.parseBoolean( editable ) );
}
parameter.setDescription( d.getChild( "description" ).getValue() );
parameter.setDeprecated( d.getChild( "deprecated" ).getValue() );
parameter.setImplementation( d.getChild( "implementation" ).getValue() );
PlexusConfiguration paramConfig = mojoConfig.getChild( parameter.getName(), false );
if ( paramConfig != null )
{
parameter.setExpression( paramConfig.getValue( null ) );
parameter.setDefaultValue( paramConfig.getAttribute( "default-value" ) );
}
parameters.add( parameter );
}