Class AbstractFilterSourcesMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.templating.AbstractFilterSourcesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
FilterSourcesMojo, FilterTestSourcesMojo

public abstract class AbstractFilterSourcesMojo extends org.apache.maven.plugin.AbstractMojo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<String>
    Set of delimiters for expressions to filter within the resources.
    protected String
    Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}
    protected org.apache.maven.shared.filtering.MavenResourcesFiltering
    The resources filtering which is used.
    protected boolean
    Controls whether to overwrite files that are not changed, by default files will not be overwritten
    protected boolean
    Skips POM projects if set to true, which is the default option.
    protected boolean
    Controls whether the default delimiters are included in addition to those configured delimiters.

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

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    addSourceFolderToProject(org.apache.maven.project.MavenProject mavenProject)
     
    protected int
     
    void
    protected abstract File
     
    protected abstract File
     

    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 Details

    • escapeString

      @Parameter(property="maven.resources.escapeString") protected String escapeString
      Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}
    • delimiters

      @Parameter protected List<String> delimiters
      Set of delimiters for expressions to filter within the resources. These delimiters are specified in the form 'beginToken*endToken'. If no '*' is given, the delimiter is assumed to be the same for start and end. So, the default filtering delimiters might be specified as:
       <delimiters>
         <delimiter>${*}</delimiter>
         <delimiter>@</delimiter>
       </delimiters>
       
      Since the '@' delimiter is the same on both ends, we don't need to specify '@*@' (though we can).
    • useDefaultDelimiters

      @Parameter(defaultValue="true") protected boolean useDefaultDelimiters
      Controls whether the default delimiters are included in addition to those configured delimiters. Does not have any effect if delimiters is empty when the defaults will be included anyway.
    • overwrite

      @Parameter(defaultValue="false") protected boolean overwrite
      Controls whether to overwrite files that are not changed, by default files will not be overwritten
    • skipPoms

      @Parameter(defaultValue="true") protected boolean skipPoms
      Skips POM projects if set to true, which is the default option.
    • mavenResourcesFiltering

      @Component(hint="default") protected org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering
      The resources filtering which is used.
  • Constructor Details

    • AbstractFilterSourcesMojo

      public AbstractFilterSourcesMojo()
  • Method Details

    • getSourceDirectory

      protected abstract File getSourceDirectory()
      Returns:
      The location of the source directory.
    • getOutputDirectory

      protected abstract File getOutputDirectory()
      Returns:
      The location of the output directory.
    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • countCopiedFiles

      protected int countCopiedFiles()
      Returns:
      number of copied files.
    • addSourceFolderToProject

      protected abstract void addSourceFolderToProject(org.apache.maven.project.MavenProject mavenProject)
      Parameters:
      mavenProject - MavenProject