public void execute(MavenSession session,
ReactorManager rm,
EventDispatcher dispatcher) throws LifecycleExecutionException, BuildFailureException {
// TODO: This is dangerous, particularly when it's just a collection of loose-leaf projects being built
// within the same reactor (using an inclusion pattern to gather them up)...
MavenProject rootProject = rm.getTopLevelProject();
List goals = session.getGoals();
if ( goals.isEmpty() && rootProject != null )
{
String goal = rootProject.getDefaultGoal();
if ( goal != null )
{
goals = Collections.singletonList( goal );
}
}
if ( goals.isEmpty() )
{
throw new BuildFailureException( "\n\nYou must specify at least one goal. Try 'mvn install' to build or 'mvn -?' for options \nSee http://maven.apache.org for more information.\n\n" );
}
List taskSegments = segmentTaskListByAggregationNeeds( goals, session, rootProject );
// TODO: probably don't want to do all this up front
findExtensions( session );
executeTaskSegments( taskSegments, rm, session, rootProject, dispatcher );
}
Execute a task. Each task may be a phase in the lifecycle or the
execution of a mojo. |