// if ( request.getLocalRepository() == null )
// {
// request.setLocalRepository( mavenTools.createLocalRepository( request.getLocalRepositoryPath() ) );
// }
EventDispatcher dispatcher = request.getEventDispatcher();
String event = MavenEvents.REACTOR_EXECUTION;
dispatcher.dispatchStart( event, request.getBaseDirectory() );
ReactorManager rm;
try
{
rm = doExecute( request, dispatcher );
}
catch ( LifecycleExecutionException e )
{
dispatcher.dispatchError( event, request.getBaseDirectory(), e );
logError( e, request.isShowErrors() );
stats( request.getStartTime() );
line();
throw new MavenExecutionException( e.getMessage(), e );
}
catch ( BuildFailureException e )
{
dispatcher.dispatchError( event, request.getBaseDirectory(), e );
logFailure( e, request.isShowErrors() );
stats( request.getStartTime() );
line();
throw new MavenExecutionException( e.getMessage(), e );
}
catch ( Throwable t )
{
dispatcher.dispatchError( event, request.getBaseDirectory(), t );
logFatal( t );
stats( request.getStartTime() );
line();
throw new MavenExecutionException( "Error executing project within the reactor", t );
}
// Either the build was successful, or it was a fail_at_end/fail_never reactor build
// TODO: should all the logging be left to the CLI?
logReactorSummary( rm );
if ( rm.hasBuildFailures() )
{
logErrors( rm, request.isShowErrors() );
if ( !ReactorManager.FAIL_NEVER.equals( rm.getFailureBehavior() ) )
{
dispatcher.dispatchError( event, request.getBaseDirectory(), null );
getLogger().info( "BUILD ERRORS" );
line();
stats( request.getStartTime() );
line();
throw new MavenExecutionException( "Some builds failed" );
}
else
{
getLogger().info( " + Ignoring failures" );
}
}
logSuccess( rm );
stats( request.getStartTime() );
line();
dispatcher.dispatchEnd( event, request.getBaseDirectory() );
}