From 8b88d97c4193c8886671a654b856661eb27c5f47 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Thu, 1 Oct 2009 10:47:10 +0000 Subject: [PATCH] o Extended error message to help diagnose bad class realms git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@820600 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/plugin/DefaultBuildPluginManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 98c658b3e2..59da6d3c95 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 @@ -116,6 +116,16 @@ public class DefaultBuildPluginManager throw new PluginExecutionException( mojoExecution, project, os.toString(), e ); } + catch ( ClassCastException e ) + { + ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 ); + PrintStream ps = new PrintStream( os ); + ps.println( "A type incompatibility occured while executing " + mojoDescriptor.getId() ); + ps.println( e ); + pluginRealm.display( ps ); + + throw new PluginExecutionException( mojoExecution, project, os.toString(), e ); + } finally { mavenPluginManager.releaseMojo( mojo, mojoExecution );