//mojoDescriptor.setRole( mojoAnnotatedClass.getClassName() );
//mojoDescriptor.setRoleHint( "default" );
mojoDescriptor.setImplementation( mojoAnnotatedClass.getClassName() );
mojoDescriptor.setLanguage( "java" );
MojoAnnotationContent mojo = mojoAnnotatedClass.getMojo();
mojoDescriptor.setDescription( mojo.getDescription() );
mojoDescriptor.setSince( mojo.getSince() );
mojo.setDeprecated( mojo.getDeprecated() );
mojoDescriptor.setProjectRequired( mojo.requiresProject() );
mojoDescriptor.setRequiresReports( mojo.requiresReports() );
mojoDescriptor.setComponentConfigurator( mojo.configurator() );
mojoDescriptor.setInheritedByDefault( mojo.inheritByDefault() );
String instantiationStrategy = mojo.instantiationStrategy().id();
if ( instantiationStrategy == null )
{
/* Perhaps the original spelling is there. */
instantiationStrategy = mojo.instanciationStrategy().id();
}
mojoDescriptor.setInstantiationStrategy( instantiationStrategy );
mojoDescriptor.setAggregator( mojo.aggregator() );
mojoDescriptor.setDependencyResolutionRequired( mojo.requiresDependencyResolution().id() );
mojoDescriptor.setDependencyCollectionRequired( mojo.requiresDependencyCollection().id() );
mojoDescriptor.setDirectInvocationOnly( mojo.requiresDirectInvocation() );
mojoDescriptor.setDeprecated( mojo.getDeprecated() );
mojoDescriptor.setThreadSafe( mojo.threadSafe() );
ExecuteAnnotationContent execute = findExecuteInParentHierarchy( mojoAnnotatedClass, mojoAnnotatedClasses );
if ( execute != null )
{
mojoDescriptor.setExecuteGoal( execute.goal() );
mojoDescriptor.setExecuteLifecycle( execute.lifecycle() );
if ( execute.phase() != null )
{
mojoDescriptor.setExecutePhase( execute.phase().id() );
}
}
mojoDescriptor.setExecutionStrategy( mojo.executionStrategy() );
// ???
//mojoDescriptor.alwaysExecute(mojo.a)
mojoDescriptor.setGoal( mojo.name() );
mojoDescriptor.setOnlineRequired( mojo.requiresOnline() );
mojoDescriptor.setPhase( mojo.defaultPhase().id() );
// Parameter annotations
Map<String, ParameterAnnotationContent> parameters =
getParametersParentHierarchy( mojoAnnotatedClass, new HashMap<String, ParameterAnnotationContent>(),
mojoAnnotatedClasses );