diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java index 805d34d02f..d1a0fada0b 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java @@ -114,7 +114,7 @@ public class DefaultBuildPluginManager throw new PluginExecutionException( mojoExecution, project, e ); } } - catch ( PluginManagerException e ) + catch ( PluginContainerException e ) { throw new PluginExecutionException( mojoExecution, project, e ); } diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginExecutionException.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginExecutionException.java index a6860eac44..b380529c97 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginExecutionException.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginExecutionException.java @@ -21,6 +21,7 @@ package org.apache.maven.plugin; import org.apache.maven.project.DuplicateArtifactAttachmentException; import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.StringUtils; public class PluginExecutionException extends PluginManagerException @@ -72,9 +73,9 @@ public class PluginExecutionException message = "Mojo execution failed"; } - if ( cause != null ) + if ( cause != null && StringUtils.isNotEmpty( cause.getMessage() ) ) { - message = ": " + cause.getMessage(); + message += ": " + cause.getMessage(); } else {