Class BaseMojo<D extends ExecData>

java.lang.Object
org.apache.maven.plugin.AbstractMojo
software.xdev.far.BaseMojo<D>
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
DirectoryNamesMojo, FileContentsMojo, FileNamesMojo, FindAndReplaceMojo

public abstract class BaseMojo<D extends ExecData> extends org.apache.maven.plugin.AbstractMojo
  • Field Details

    • project

      @Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
    • baseDir

      @Parameter(property="baseDir", defaultValue="${basedir}") protected String baseDir
      The base directory from which to perform the find and replace. This is relative to the location of the pom.
    • recursive

      @Parameter(property="recursive", defaultValue="false") protected boolean recursive
      Whether the find and replace is recursive from the baseDir.
    • findRegex

      @Parameter(property="findRegex", required=true) protected String findRegex
      The regex string to find.
    • replaceValue

      @Parameter(property="replaceValue") protected String replaceValue
      The value to replace the matching findRegex with.
    • fileMask

      @Parameter(property="fileMask") protected String fileMask
      A CSV of the file types to search in. For example for the value: .xml Only files ending with .xml will be renamed.

      For the value: .xml,.properties Only files ending with .xml,.properties will be renamed.

      Ignored for directories.

    • exclusions

      @Parameter(property="exclusions") protected String exclusions
      Regex filenames/directory-names to exclude.
    • skip

      @Parameter(property="skip", defaultValue="false") protected boolean skip
      Skip execution of the plugin.
    • replaceAll

      @Parameter(property="replaceAll", defaultValue="true") protected boolean replaceAll
      Whether the find and replace maven plugin replaces all matches or just the first match.
    • executeInternal

      protected final Consumer<D extends ExecData> executeInternal
  • Constructor Details

    • BaseMojo

      protected BaseMojo(Consumer<D> executeInternal)
  • Method Details

    • execute

      public void execute()
    • createDefaultData

      protected ExecData createDefaultData()
    • compileFindRegex

      protected Pattern compileFindRegex()
    • enrichData

      protected abstract D enrichData(ExecData data)
    • setProject

      public void setProject(org.apache.maven.project.MavenProject project)
    • setBaseDir

      public void setBaseDir(String baseDir)
    • setRecursive

      public void setRecursive(boolean recursive)
    • setFindRegex

      public void setFindRegex(String findRegex)
    • setReplaceValue

      public void setReplaceValue(String replaceValue)
    • setFileMask

      public void setFileMask(String fileMask)
    • setExclusions

      public void setExclusions(String exclusions)
    • setSkip

      public void setSkip(boolean skip)
    • setReplaceAll

      public void setReplaceAll(boolean replaceAll)