Package software.xdev.far
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe base directory from which to perform the find and replace.protected StringRegex filenames/directory-names to exclude.protected StringA CSV of the file types to search in.protected StringThe regex string to find.protected org.apache.maven.project.MavenProjectprotected booleanWhether the find and replace is recursive from the baseDir.protected booleanWhether the find and replace maven plugin replaces all matches or just the first match.protected StringThe value to replace the matching findRegex with.protected booleanSkip execution of the plugin.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Patternprotected ExecDataprotected abstract DenrichData(ExecData data) voidexecute()voidsetBaseDir(String baseDir) voidsetExclusions(String exclusions) voidsetFileMask(String fileMask) voidsetFindRegex(String findRegex) voidsetProject(org.apache.maven.project.MavenProject project) voidsetRecursive(boolean recursive) voidsetReplaceAll(boolean replaceAll) voidsetReplaceValue(String replaceValue) voidsetSkip(boolean skip) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project -
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 recursiveWhether the find and replace is recursive from the baseDir. -
findRegex
The regex string to find. -
replaceValue
The value to replace the matching findRegex with. -
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
Regex filenames/directory-names to exclude. -
skip
@Parameter(property="skip", defaultValue="false") protected boolean skipSkip execution of the plugin. -
replaceAll
@Parameter(property="replaceAll", defaultValue="true") protected boolean replaceAllWhether the find and replace maven plugin replaces all matches or just the first match. -
executeInternal
-
-
Constructor Details
-
BaseMojo
-
-
Method Details
-
execute
public void execute() -
createDefaultData
-
compileFindRegex
-
enrichData
-
setProject
public void setProject(org.apache.maven.project.MavenProject project) -
setBaseDir
-
setRecursive
public void setRecursive(boolean recursive) -
setFindRegex
-
setReplaceValue
-
setFileMask
-
setExclusions
-
setSkip
public void setSkip(boolean skip) -
setReplaceAll
public void setReplaceAll(boolean replaceAll)
-