From cf8820b905afadc9cdf08406b48968363bd63d76 Mon Sep 17 00:00:00 2001 From: Trygve Laugstol Date: Fri, 2 Sep 2005 14:56:22 +0000 Subject: [PATCH] Fixing MNG-825: "Clean plugin should fail if unable to delete target" o Changed the default from complaining through the logger to throwing an exception. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@267218 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/plugin/clean/CleanPlugin.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java b/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java index 4bb2f599d6..7b50a3b8d0 100644 --- a/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java +++ b/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java @@ -22,10 +22,10 @@ import org.apache.maven.plugin.MojoExecutionException; import java.io.File; /** - * @author Emmanuel Venisse - * @version $Id$ * @goal clean * @description Goal which cleans the build + * @author Emmanuel Venisse + * @version $Id$ */ public class CleanPlugin extends AbstractMojo @@ -91,6 +91,7 @@ public class CleanPlugin * @param d the directory to delete */ protected void removeDir( File d ) + throws MojoExecutionException { String[] list = d.list(); if ( list == null ) @@ -113,11 +114,11 @@ public class CleanPlugin // TODO:... // if ( failOnError ) // { -// throw new Exception( message ); + throw new MojoExecutionException( message ); // } // else // { - getLog().info( message ); +// getLog().info( message ); // } } } @@ -129,13 +130,12 @@ public class CleanPlugin // TODO:... // if ( failOnError ) // { -// throw new Exception( message ); + throw new MojoExecutionException( message ); // } // else // { - getLog().info( message ); +// getLog().info( message ); // } } } - }