mirror of https://github.com/apache/maven.git
Cleaning up diagnosis output for MojoExecutionException's.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@314785 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
60854c5f75
commit
06dc81b54e
|
@ -17,16 +17,35 @@ public class MojoExecutionExceptionDiagnoser
|
||||||
|
|
||||||
StringBuffer message = new StringBuffer();
|
StringBuffer message = new StringBuffer();
|
||||||
|
|
||||||
message.append( "Error executing mojo: " ).append( mee.getSource() ).append( "\n\n" );
|
message.append( "Error executing mojo" );
|
||||||
message.append( mee.getLongMessage() ).append( "\n\n" );
|
|
||||||
|
Object source = mee.getSource();
|
||||||
|
if ( source != null )
|
||||||
|
{
|
||||||
|
message.append( ": " ).append( mee.getSource() ).append( "\n" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message.append( ".\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
message.append( "\nMessage: " ).append( mee.getMessage() );
|
||||||
|
|
||||||
|
String longMessage = mee.getLongMessage();
|
||||||
|
if ( longMessage != null )
|
||||||
|
{
|
||||||
|
message.append( "\n\n" ).append( longMessage );
|
||||||
|
}
|
||||||
|
|
||||||
Throwable root = DiagnosisUtils.getRootCause( mee );
|
Throwable root = DiagnosisUtils.getRootCause( mee );
|
||||||
|
|
||||||
if ( root != null && root != mee )
|
if ( root != null && root != mee )
|
||||||
{
|
{
|
||||||
message.append( "Root Cause: " ).append( root.getMessage() ).append( "\n\n" );
|
message.append( "\n\nRoot Cause: " ).append( root.getMessage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message.append( "\n\n" );
|
||||||
|
|
||||||
return message.toString();
|
return message.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue