{
sortedProjects = getSortedProjects();
}
catch ( Exception e )
{
throw new JellyTagException( "Error getting projects", e );
}
LOGGER.info( "Our processing order:" );
for ( Iterator i = sortedProjects.iterator(); i.hasNext(); )
{
Project p = (Project) i.next();
LOGGER.info( p.getName() );
}
ArrayList reactorProjects = new ArrayList();
Runtime r = Runtime.getRuntime();
for ( Iterator i = sortedProjects.iterator(); i.hasNext(); )
{
// The basedir needs to be set for the project
// We just need the descriptor.
Project project = (Project) i.next();
beforeProject( project );
final long mb = 1024 * 1024;
LOGGER.info( "+----------------------------------------" );
LOGGER.info( "| " + getBanner() + " " + project.getName() );
LOGGER.info( "| Memory: " + ( ( r.totalMemory() - r.freeMemory() ) / mb ) + "M/" + ( r.totalMemory() / mb )
+ "M" );
LOGGER.info( "+----------------------------------------" );
// We only try to attain goals if they have been set. The reactor
// might be in use to collect project information for the purpose
// of, say, generating a sites from a set of components.
List goalList = null;
if ( getGoals() != null )
{
goalList = MavenUtils.getGoalListFromCsv( getGoals() );
}
beforeLaunchGoals( project );
try
{
if ( !collectOnly )
{
getMavenContext().getMavenSession().attainGoals( project, goalList );
}
}
catch ( Exception e )
{
onException( project, e );
// TODO: there is a risk that continuing may leave the project in an inconsistent state.
// -- attainGoals needs to split fatal from non-fatal exceptions and we only ignore non-fatal
if ( !isIgnoreFailures() )
{
throw new JellyTagException( "Reactor subproject failure occurred", e );
}
}
afterLaunchGoals( project );
afterProject( project );