org.apache.maven.plugin.clean
Class CleanMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.clean.CleanMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class CleanMojo
extends org.apache.maven.plugin.AbstractMojo

Goal which cleans the build.

This attempts to clean a project's working directory of the files that were generated at build-time. By default, it discovers and deletes the directories configured in project.build.directory, project.build.outputDirectory, project.build.testOutputDirectory, and project.reporting.outputDirectory.

Files outside the default may also be included in the deletion by configuring the filesets tag.

Since:
2.0
Version:
$Id: CleanMojo.java 692713 2008-09-06 19:41:56Z bentmann $
Author:
Emmanuel Venisse
See Also:
Fileset

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
CleanMojo()
           
 
Method Summary
 void addFileset(Fileset fileset)
          Adds a file-set to the list of file-sets to clean.
 void execute()
          Deletes file-sets in the following project build directory order: (source) directory, output directory, test directory, report directory, and then the additional file-sets.
protected  void setDirectory(java.io.File newDirectory)
          Sets the project build directory.
protected  void setOutputDirectory(java.io.File newOutputDirectory)
          Sets the project build output directory.
protected  void setReportDirectory(java.io.File newReportDirectory)
          Sets the project build report directory.
protected  void setTestOutputDirectory(java.io.File newTestOutputDirectory)
          Sets the project build test output directory.
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CleanMojo

public CleanMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Deletes file-sets in the following project build directory order: (source) directory, output directory, test directory, report directory, and then the additional file-sets.

Throws:
org.apache.maven.plugin.MojoExecutionException - When a directory failed to get deleted.
See Also:
Mojo.execute()

setDirectory

protected void setDirectory(java.io.File newDirectory)
Sets the project build directory.

Parameters:
newDirectory - The project build directory to set.

setOutputDirectory

protected void setOutputDirectory(java.io.File newOutputDirectory)
Sets the project build output directory.

Parameters:
newOutputDirectory - The project build output directory to set.

setTestOutputDirectory

protected void setTestOutputDirectory(java.io.File newTestOutputDirectory)
Sets the project build test output directory.

Parameters:
newTestOutputDirectory - The project build test output directory to set.

setReportDirectory

protected void setReportDirectory(java.io.File newReportDirectory)
Sets the project build report directory.

Parameters:
newReportDirectory - The project build report directory to set.

addFileset

public void addFileset(Fileset fileset)
Adds a file-set to the list of file-sets to clean.

Parameters:
fileset - the fileset


Copyright © 2001-2012. All Rights Reserved.