Class TextFileMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
de.iip_ecosphere.platform.configuration.maven.TextFileMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="textFile",
defaultPhase=COMPILE)
public class TextFileMojo
extends org.apache.maven.plugin.AbstractMojo
Allows simple line-based modifications to a text file.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Fileprivate List<TextFileMojo.ReplacementSpec> private booleanFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringapplyReplacements(String line) Applies the specified replacements toline.voidexecute()private booleanChecks whether the givenspecis disabled.private static booleanisNonEmpty(Collection<?> coll) Returns whether a collection is not null and not empty.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
skip
@Parameter(property="configuration.textFile.skip", required=false, defaultValue="false") private boolean skip -
file
-
prepends
-
appends
-
deletions
-
disabled
-
replacements
-
-
Constructor Details
-
TextFileMojo
public TextFileMojo()
-
-
Method Details
-
isDisabled
Checks whether the givenspecis disabled.- Parameters:
spec- the replacement specification- Returns:
truefor disabled,falseelse
-
applyReplacements
Applies the specified replacements toline.- Parameters:
line- the line to apply the replacements to- Returns:
- the line with applied replacements
-
isNonEmpty
Returns whether a collection is not null and not empty.- Parameters:
coll- the collection to test- Returns:
truefor not empty,falseelse
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-