{
ExceptionHandler handler = new DefaultExceptionHandler();
Map<String, String> references = new LinkedHashMap<String, String>();
MavenProject project = null;
for ( Throwable exception : result.getExceptions() )
{
ExceptionSummary summary = handler.handleException( exception );
logSummary( summary, references, "", cliRequest.showErrors );
if ( project == null && exception instanceof LifecycleExecutionException )
{
project = ( (LifecycleExecutionException) exception ).getProject();
}
}
logger.error( "" );
if ( !cliRequest.showErrors )
{
logger.error( "To see the full stack trace of the errors, re-run Maven with the -e switch." );
}
if ( !logger.isDebugEnabled() )
{
logger.error( "Re-run Maven using the -X switch to enable full debug logging." );
}
if ( !references.isEmpty() )
{
logger.error( "" );
logger.error( "For more information about the errors and possible solutions"
+ ", please read the following articles:" );
for ( Map.Entry<String, String> entry : references.entrySet() )
{
logger.error( entry.getValue() + " " + entry.getKey() );
}
}
if ( project != null && !project.equals( result.getTopologicallySortedProjects().get( 0 ) ) )
{
logger.error( "" );
logger.error( "After correcting the problems, you can resume the build with the command" );
logger.error( " mvn <goals> -rf :" + project.getArtifactId() );
}
if ( MavenExecutionRequest.REACTOR_FAIL_NEVER.equals( cliRequest.request.getReactorFailureBehavior() ) )
{
logger.info( "Build failures were ignored." );