throws LifecycleExecutionException, PluginNotFoundException
{
String packaging = project.getPackaging();
List optionalMojos = null;
LifecycleMapping m = (LifecycleMapping) findExtension( project, LifecycleMapping.ROLE, packaging, session
.getSettings(), session.getLocalRepository() );
if ( m != null )
{
optionalMojos = m.getOptionalMojos( lifecycle.getId() );
}
if ( optionalMojos == null )
{
try
{
m = (LifecycleMapping) session.lookup( LifecycleMapping.ROLE, packaging );
optionalMojos = m.getOptionalMojos( lifecycle.getId() );
}
catch ( ComponentLookupException e )
{
getLogger().debug( "Error looking up lifecycle mapping to retrieve optional mojos. Lifecycle ID: " +
lifecycle.getId() + ". Error: " + e.getMessage(), e );