if ( !( packaging.equals( SWC ) || packaging.equals( SWF ) ) )
{
return;
}
Configurator cfg = configurators.get( configurator );
if ( cfg == null )
{
// not a plexus component, trying brute force
Class<Configurator> cfgClass;
try
{
cfgClass = (Class<Configurator>) Class.forName( configurator );
}
catch ( ClassNotFoundException e )
{
throw new MojoExecutionException( "Configurator not found: " + configurator, e );
}
try
{
cfg = cfgClass.newInstance();
}
catch ( Exception e )
{
throw new MojoExecutionException( "Erro creating a new configurator instance: " + configurator, e );
}
}
if ( parameters == null )
{
parameters = new LinkedHashMap<String, Object>();
}
parameters.put( "project", project );
parameters.put( "classifier", classifier );
try
{
if ( SWC.equals( getProjectType() ) )
{
cfg.buildConfiguration( (ICompcConfiguration) this, parameters );
}
else
{
cfg.buildConfiguration( (ICommandLineConfiguration) this, getSourceFile(), parameters );
}
}
catch ( ConfiguratorException e )
{
throw new MojoExecutionException( "Failed to execute configurator: " + e.getMessage(), e );