From 191af0e6788817e26d9c67e32ec04f0313799939 Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Wed, 11 Jan 2006 03:38:18 +0000 Subject: [PATCH] Removing xalan dep, and fixing runnable mojo. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@367900 13f79535-47bb-0310-9956-ffa450edef68 --- integration-tests/maven-core-it-plugin/pom.xml | 2 +- .../org/apache/maven/plugin/coreit/RunnableMojo.java | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/integration-tests/maven-core-it-plugin/pom.xml b/integration-tests/maven-core-it-plugin/pom.xml index 2da63b2df5..94af9ca843 100644 --- a/integration-tests/maven-core-it-plugin/pom.xml +++ b/integration-tests/maven-core-it-plugin/pom.xml @@ -3,7 +3,7 @@ maven-plugin-parent org.apache.maven.plugins - 2.0-beta-3 + 2.0.1 4.0.0 maven-core-it-plugin diff --git a/integration-tests/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/RunnableMojo.java b/integration-tests/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/RunnableMojo.java index 1d91dd24ab..26a23970fa 100644 --- a/integration-tests/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/RunnableMojo.java +++ b/integration-tests/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/RunnableMojo.java @@ -4,7 +4,7 @@ import bsh.EvalError; import bsh.Interpreter; import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.MojoExecutionException; /** * @goal runnable @@ -19,7 +19,7 @@ public class RunnableMojo */ private String script; - public void execute() throws MojoFailureException + public void execute() throws MojoExecutionException { Interpreter terp = new Interpreter(); @@ -27,14 +27,13 @@ public class RunnableMojo { getLog().info( "Executing in java version: " + System.getProperty( "java.version" ) ); - Class result = (Class) terp.eval( script ); + Object result = terp.eval( script ); - getLog().info( "Result of script evaluation was: " + result + "\nLoaded from: " + result.getClassLoader() ); + getLog().info( "Result of script evaluation was: " + result + "\nLoaded from: " + result.getClass().getClassLoader() ); } catch ( EvalError e ) { - throw new MojoFailureException( this, "Failed to evaluate script.", "Script: \n\n" + script - + "\n\nfailed to evaluate. Error: " + e.getMessage() + "\nLine: " + e.getErrorLineNumber() ); + throw new MojoExecutionException( "Failed to evaluate script.", e ); } } }