You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2005/09/22 11:49:21 UTC
svn commit: r290923 -
/maven/components/trunk/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java
Author: brett
Date: Thu Sep 22 02:49:18 2005
New Revision: 290923
URL: http://svn.apache.org/viewcvs?rev=290923&view=rev
Log:
other directories may not be under target
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=290923&r1=290922&r2=290923&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 Thu Sep 22 02:49:18 2005
@@ -22,8 +22,9 @@
import java.io.File;
/**
+ * Goal which cleans the build.
+
* @goal clean
- * @description Goal which cleans the build
* @author <a href="mailto:evenisse@maven.org">Emmanuel Venisse</a>
* @version $Id$
*/
@@ -33,24 +34,45 @@
private static final int DELETE_RETRY_SLEEP_MILLIS = 10;
/**
- * This is where compiled classes go.
+ * This is where build results go.
*
* @parameter expression="${project.build.directory}"
* @required
* @readonly
*/
- private String outputDirectory;
+ private File directory;
+
+ /**
+ * This is where compiled classes go.
+ *
+ * @parameter expression="${project.build.outputDirectory}"
+ * @required
+ * @readonly
+ */
+ private File outputDirectory;
- // TODO: not in the descriptor previously
-// private boolean failOnError;
+ /**
+ * This is where compiled test classes go.
+ *
+ * @parameter expression="${project.build.testOutputDirectory}"
+ * @required
+ * @readonly
+ */
+ private File testOutputDirectory;
public void execute()
throws MojoExecutionException
{
- if ( outputDirectory != null )
- {
- File dir = new File( outputDirectory );
+ removeDirectory( directory );
+ removeDirectory( outputDirectory );
+ removeDirectory( testOutputDirectory );
+ }
+ private void removeDirectory( File dir )
+ throws MojoExecutionException
+ {
+ if ( dir != null )
+ {
if ( dir.exists() && dir.isDirectory() )
{
getLog().info( "Deleting directory " + dir.getAbsolutePath() );
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org