You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2006/02/15 00:52:57 UTC
svn commit: r377894 - in /maven/plugins/trunk/maven-clean-plugin: pom.xml
src/main/java/org/apache/maven/plugin/clean/CleanMojo.java
Author: jdcasey
Date: Tue Feb 14 15:52:56 2006
New Revision: 377894
URL: http://svn.apache.org/viewcvs?rev=377894&view=rev
Log:
Changed to reflect changes in the file-management library, which allow the mojo to pass in a monitor adapter for logging, and a verbose flag.
Modified:
maven/plugins/trunk/maven-clean-plugin/pom.xml
maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java
Modified: maven/plugins/trunk/maven-clean-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clean-plugin/pom.xml?rev=377894&r1=377893&r2=377894&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-clean-plugin/pom.xml Tue Feb 14 15:52:56 2006
@@ -17,5 +17,10 @@
<artifactId>file-management</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-monitor</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
Modified: maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java?rev=377894&r1=377893&r2=377894&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java (original)
+++ maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java Tue Feb 14 15:52:56 2006
@@ -19,7 +19,8 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.shared.model.fileset.FileSet;
-import org.apache.maven.shared.model.fileset.util.FileSetUtils;
+import org.apache.maven.shared.model.fileset.util.FileSetManager;
+import org.apache.maven.shared.monitor.MojoLogMonitorAdaptor;
import java.io.File;
import java.io.IOException;
@@ -39,7 +40,7 @@
/**
* This is where build results go.
*
- * @parameter expression="${project.build.directory}"
+ * @parameter default-value="${project.build.directory}"
* @required
* @readonly
*/
@@ -48,7 +49,7 @@
/**
* This is where compiled classes go.
*
- * @parameter expression="${project.build.outputDirectory}"
+ * @parameter default-value="${project.build.outputDirectory}"
* @required
* @readonly
*/
@@ -57,7 +58,7 @@
/**
* This is where compiled test classes go.
*
- * @parameter expression="${project.build.testOutputDirectory}"
+ * @parameter default-value="${project.build.testOutputDirectory}"
* @required
* @readonly
*/
@@ -66,12 +67,13 @@
/**
* Be verbose in the debug log-level?
*
- * @parameter default=value="false" expression="${clean.verbose}"
+ * @parameter expression="${clean.verbose}" default=value="false"
*/
private boolean verbose;
/**
* The list of filesets to delete, in addition to the default directories.
+ *
* @parameter
*/
private List filesets;
@@ -79,13 +81,20 @@
/**
* Should we follow symbolically linked files?
*
- * @parameter default=value="false" expression="${clean.followSymLinks}"
+ * @parameter expression="${clean.followSymLinks}" default=value="false"
*/
private boolean followSymLinks;
+ private FileSetManager fileSetManager;
+
public void execute()
throws MojoExecutionException
{
+ getLog().info( "Be verbose? " + verbose );
+
+ MojoLogMonitorAdaptor monitor = new MojoLogMonitorAdaptor( getLog() );
+ fileSetManager = new FileSetManager( monitor, verbose );
+
removeDirectory( directory );
removeDirectory( outputDirectory );
removeDirectory( testOutputDirectory );
@@ -104,7 +113,8 @@
try
{
getLog().info( "Deleting " + fileset );
- FileSetUtils.delete( fileset );
+
+ fileSetManager.delete( fileset );
}
catch ( IOException e )
{
@@ -125,7 +135,7 @@
try
{
getLog().info( "Deleting directory " + dir.getAbsolutePath() );
- FileSetUtils.delete( fs );
+ fileSetManager.delete( fs );
}
catch ( IOException e )
{