From 7b1f2de2599a431e46c37ce7ac0abffb6c50a3ef Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Tue, 22 Mar 2005 06:43:31 +0000 Subject: [PATCH] can't be half and half! move to new plugin model git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163644 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/coreit/CoreItMojo.java | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java b/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java index 49d58a18c7..2ace464af5 100644 --- a/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java +++ b/maven-core-it-plugin/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java @@ -17,9 +17,9 @@ package org.apache.maven.plugin.coreit; */ import org.apache.maven.plugin.AbstractPlugin; -import org.apache.maven.plugin.PluginExecutionRequest; -import org.apache.maven.plugin.PluginExecutionResponse; +import org.apache.maven.plugin.PluginExecutionException; +import java.io.IOException; import java.io.File; import java.io.FileWriter; @@ -60,8 +60,8 @@ public class CoreItMojo private String goalItem; - public void execute( PluginExecutionRequest request, PluginExecutionResponse response ) - throws Exception + public void execute() + throws PluginExecutionException { touch( new File( outputDirectory ), "touch.txt" ); @@ -83,19 +83,26 @@ public class CoreItMojo } private static void touch( File dir, String file ) - throws Exception + throws PluginExecutionException { - if ( !dir.exists() ) + try { - dir.mkdirs(); + if ( !dir.exists() ) + { + dir.mkdirs(); + } + + File touch = new File( dir, file ); + + FileWriter w = new FileWriter( touch ); + + w.write( file ); + + w.close(); + } + catch ( IOException e ) + { + throw new PluginExecutionException( "Error touching file", e ); } - - File touch = new File( dir, file ); - - FileWriter w = new FileWriter( touch ); - - w.write( file ); - - w.close(); } }