org.apache.maven.plugin.clean
public class CleanMojo extends org.apache.maven.plugin.AbstractMojo
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.
Fileset
Constructor and Description |
---|
CleanMojo() |
Modifier and Type | Method and Description |
---|---|
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.
|
public void execute() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- When a directory failed to get deleted.Mojo.execute()
protected void setDirectory(java.io.File newDirectory)
newDirectory
- The project build directory to set.protected void setOutputDirectory(java.io.File newOutputDirectory)
newOutputDirectory
- The project build output directory to set.protected void setTestOutputDirectory(java.io.File newTestOutputDirectory)
newTestOutputDirectory
- The project build test output directory to set.protected void setReportDirectory(java.io.File newReportDirectory)
newReportDirectory
- The project build report directory to set.public void addFileset(Fileset fileset)
fileset
- the filesetCopyright © 2001-2014. All Rights Reserved.