Class CleanMojo

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

@Mojo(name="clean") public class CleanMojo extends AbstractLuteceWebappMojo
Goal which cleans the build. Especially for the multi-modules projects.

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.

  • Constructor Details

    • CleanMojo

      public CleanMojo()
  • Method Details

    • 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
      See Also:
      • Mojo.execute()
    • setTestOutputDirectory

      protected void setTestOutputDirectory(File newTestOutputDirectory)
      Sets the project build test output directory.
      Parameters:
      newTestOutputDirectory - The project build test output directory to set.
    • setReportDirectory

      protected void setReportDirectory(File newReportDirectory)
      Sets the project build report directory.
      Parameters:
      newReportDirectory - The project build report directory to set.
    • addFileset

      public void addFileset(org.apache.maven.shared.model.fileset.FileSet fileset)
      Adds a file-set to the list of file-sets to clean.
      Parameters:
      fileset - the fileset