FileLogger logger )
throws RunFailureException
{
if ( result.getExecutionException() != null )
{
throw new RunFailureException( "The Maven invocation failed. "
+ result.getExecutionException().getMessage(), BuildJob.Result.ERROR );
}
else if ( !invokerProperties.isExpectedResult( result.getExitCode(), invocationIndex ) )
{
StringBuilder buffer = new StringBuilder( 256 );
buffer.append( "The build exited with code " ).append( result.getExitCode() ).append( ". " );
if ( logger != null )
{
buffer.append( "See " );
buffer.append( logger.getOutputFile().getAbsolutePath() );
buffer.append( " for details." );
}
else
{
buffer.append( "See console output for details." );
}
throw new RunFailureException( buffer.toString(), BuildJob.Result.FAILURE_BUILD );
}
}