org.apache.maven.plugin.clean

## Class CleanMojo

- java.lang.Object
- - org.apache.maven.plugin.AbstractMojo
  - - 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 1026638 2010-10-23 16:30:17Z bentmann $
Author:
  Emmanuel Venisse
See Also:
  `Fileset`

### Field Summary

### Fields inherited from interface org.apache.maven.plugin.Mojo

`ROLE`

### Constructor Summary

Constructors
Constructor and Description
`CleanMojo()`

### Method Summary

Methods
`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.

### 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()`