public ComponentSetDescriptor createComponentDescriptors( Reader componentDescriptorReader, String source )
throws PlexusConfigurationException
{
PlexusConfiguration componentDescriptorConfiguration = PlexusTools.buildConfiguration( source, componentDescriptorReader );
ComponentSetDescriptor componentSetDescriptor = new ComponentSetDescriptor();
List componentDescriptors = new ArrayList();
PlexusConfiguration[] componentConfigurations =
componentDescriptorConfiguration.getChild( "components" ).getChildren( "component" );
for ( int i = 0; i < componentConfigurations.length; i++ )
{
PlexusConfiguration componentConfiguration = componentConfigurations[i];
ComponentDescriptor componentDescriptor;
try
{
componentDescriptor = PlexusTools.buildComponentDescriptor( componentConfiguration );
}
catch ( PlexusConfigurationException e )
{
throw new PlexusConfigurationException( "Cannot process component descriptor: " + source, e );
}
componentDescriptor.setSource( source );
componentDescriptor.setComponentType( "plexus" );
componentDescriptors.add( componentDescriptor );
}
componentSetDescriptor.setComponents( componentDescriptors );
// TODO: read and store the dependencies
return componentSetDescriptor;
}