private void populatePluginFields( Object mojo, MojoDescriptor mojoDescriptor, ClassRealm pluginRealm,
PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator )
throws PluginConfigurationException
{
ComponentConfigurator configurator = null;
String configuratorId = mojoDescriptor.getComponentConfigurator();
if ( StringUtils.isEmpty( configuratorId ) )
{
configuratorId = "basic";
}
try
{
// TODO: could the configuration be passed to lookup and the configurator known to plexus via the descriptor
// so that this method could entirely be handled by a plexus lookup?
configurator = container.lookup( ComponentConfigurator.class, configuratorId );
ConfigurationListener listener = new DebugConfigurationListener( logger );
ValidatingConfigurationListener validator =
new ValidatingConfigurationListener( mojo, mojoDescriptor, listener );
logger.debug( "Configuring mojo '" + mojoDescriptor.getId() + "' with " + configuratorId
+ " configurator -->" );
configurator.configureComponent( mojo, configuration, expressionEvaluator, pluginRealm, validator );
logger.debug( "-- end configuration --" );
Collection<Parameter> missingParameters = validator.getMissingParameters();
if ( !missingParameters.isEmpty() )