Set resolveJellyScriptHousings( String goal )
throws NoSuchGoalException
{
LOGGER.debug( "preparing goal: " + goal );
Set pluginSet = new InsertionOrderedSet();
Goal[] chain = getExecutionChain( goal, goalProject );
LOGGER.debug( "execution chain: " + Arrays.asList( chain ).toString() );
for ( int i = 0; i < chain.length; i++ )
{
Goal g = chain[i];
Object plugin = goalPluginMap.get( g.getName() );
if ( plugin == null )
{
throw new NoSuchGoalException( g.getName() );
}
pluginSet.add( plugin );
Collection decorators = getPostGoalDecorators( g.getName() );
if ( LOGGER.isDebugEnabled() && !decorators.isEmpty() )
{
LOGGER.debug( "goal " + g.getName() + " has postGoal decorators " + decorators );
}
pluginSet.addAll( decorators );
decorators = getPreGoalDecorators( g.getName() );
if ( LOGGER.isDebugEnabled() && !decorators.isEmpty() )
{
LOGGER.debug( "goal " + g.getName() + " has preGoal decorators " + decorators );
}
pluginSet.addAll( decorators );
}
// Done like this as the dynatag plugin dependencies must be first in the list
InsertionOrderedSet newPluginSet = resolveDynaTagPlugins( pluginSet );
if ( LOGGER.isDebugEnabled() && !newPluginSet.isEmpty() )
{
LOGGER.debug( "dynatag dependencies: " + newPluginSet );
}
newPluginSet.addAll( pluginSet );
pluginSet = newPluginSet;
// Here we make the resolved plugins field be the full set of plugins, and the plugins returned just the
// additional ones resolved.
// TODO: skip the remove step - don't add if it is already loaded