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
This commit is contained in:
Trygve Laugstol 2005-09-02 14:56:22 +00:00
parent ba64a79e28
commit cf8820b905
1 changed files with 7 additions and 7 deletions

View File

@ -22,10 +22,10 @@ import org.apache.maven.plugin.MojoExecutionException;
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 @@ 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 );
// }
}
}
}