You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by tr...@apache.org on 2005/09/02 16:56:24 UTC

svn commit: r267218 - /maven/components/trunk/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java

Author: trygvis
Date: Fri Sep  2 07:56:22 2005
New Revision: 267218

URL: http://svn.apache.org/viewcvs?rev=267218&view=rev
Log:
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.

Modified:
    maven/components/trunk/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java

Modified: maven/components/trunk/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java?rev=267218&r1=267217&r2=267218&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java (original)
+++ maven/components/trunk/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java Fri Sep  2 07:56:22 2005
@@ -22,10 +22,10 @@
 import java.io.File;
 
 /**
- * @author <a href="mailto:evenisse@maven.org">Emmanuel Venisse</a>
- * @version $Id$
  * @goal clean
  * @description Goal which cleans the build
+ * @author <a href="mailto:evenisse@maven.org">Emmanuel Venisse</a>
+ * @version $Id$
  */
 public class CleanPlugin
     extends AbstractMojo
@@ -91,6 +91,7 @@
      * @param d the directory to delete
      */
     protected void removeDir( File d )
+        throws MojoExecutionException
     {
         String[] list = d.list();
         if ( list == null )
@@ -113,11 +114,11 @@
 // TODO:...
 //                    if ( failOnError )
 //                    {
-//                        throw new Exception( message );
+                        throw new MojoExecutionException( message );
 //                    }
 //                    else
 //                    {
-                    getLog().info( message );
+//                        getLog().info( message );
 //                    }
                 }
             }
@@ -129,13 +130,12 @@
 // TODO:...
 //            if ( failOnError )
 //            {
-//                throw new Exception( message );
+                throw new MojoExecutionException( message );
 //            }
 //            else
 //            {
-            getLog().info( message );
+//                getLog().info( message );
 //            }
         }
     }
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org