Class PreprocessorClearMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="clear",
          defaultPhase=PACKAGE,
          threadSafe=true,
          requiresProject=true)
    public class PreprocessorClearMojo
    extends org.apache.maven.plugin.AbstractMojo
    The Mojo allows to delete preprocessed folders.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<org.apache.maven.shared.model.fileset.FileSet> fileSets
      List of folders and files to be removed, every folder defined as a FileSet and can contain exclude and include lists.
      private java.io.File preprocessedSources
      The Destination folder where generated sources can be placed in non-test mode and which will be removed.
      private java.io.File preprocessedTestSources
      Destination folder where generated sources can be placed in test-mode and which will be removed.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      private void processFileSet​(java.util.List<org.apache.maven.shared.model.fileset.FileSet> fileSets, org.slf4j.Logger log)  
      private void processPredefinedFolders​(org.slf4j.Logger log)  
      • 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
    • Field Detail

      • preprocessedSources

        @Parameter(alias="preprocessedSources",
                   readonly=true,
                   defaultValue="${project.build.directory}/generated-sources/preprocessed")
        private java.io.File preprocessedSources
        The Destination folder where generated sources can be placed in non-test mode and which will be removed.
      • preprocessedTestSources

        @Parameter(alias="preprocessedTestSources",
                   readonly=true,
                   defaultValue="${project.build.directory}/generated-test-sources/preprocessed")
        private java.io.File preprocessedTestSources
        Destination folder where generated sources can be placed in test-mode and which will be removed.
      • fileSets

        @Parameter(alias="fileSets",
                   required=false)
        private java.util.List<org.apache.maven.shared.model.fileset.FileSet> fileSets
        List of folders and files to be removed, every folder defined as a FileSet and can contain exclude and include lists.
          <fileSets>
            <fileSet>
              <directory>${basedir}/someFolder</directory>
              <includes>
                <include>*.txt</include>
              </includes>
            </fileSet>
          </fileSets>
         
        See Also:
        FileSet javadoc
    • Constructor Detail

      • PreprocessorClearMojo

        public PreprocessorClearMojo()
    • Method Detail

      • processPredefinedFolders

        private void processPredefinedFolders​(org.slf4j.Logger log)
                                       throws org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoFailureException
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • processFileSet

        private void processFileSet​(@MustNotContainNull
                                    java.util.List<org.apache.maven.shared.model.fileset.FileSet> fileSets,
                                    org.slf4j.Logger log)
                             throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException