diff --git a/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java b/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java index 12f9d2436a..3d9b634b77 100644 --- a/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java +++ b/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java @@ -205,7 +205,7 @@ public class DefaultExceptionHandler { reference = getReference( exception.getCause() ); } - else if ( !( exception instanceof RuntimeException ) ) + else if ( isNoteworthyException( exception ) ) { reference = exception.getClass().getSimpleName(); } @@ -219,6 +219,27 @@ public class DefaultExceptionHandler return reference; } + private boolean isNoteworthyException( Throwable exception ) + { + if ( exception == null ) + { + return false; + } + else if ( exception instanceof Error ) + { + return true; + } + else if ( exception instanceof RuntimeException ) + { + return false; + } + else if ( exception.getClass().getName().startsWith( "java" ) ) + { + return false; + } + return true; + } + private String getMessage( String message, Throwable exception ) { String fullMessage = ( message != null ) ? message : "";