Class AbstractExecSetPropertyMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.dellroad.stuff.maven.AbstractExecSetPropertyMojo
- All Implemented Interfaces:
ContextEnabled, Mojo
- Direct Known Subclasses:
ExecSetPropertyMojo, GitDescribeMojo, SvnVersionMojo
Support superclass for mojo's that execute some command and set a property based on the resulting output.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecuteAndSetProperty(File directory, List<String> command) Execute command and set the property from standard output.protected abstract StringGet the name of the property to set.protected booleanisNonEmpty(String value) Methods inherited from class AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
AbstractExecSetPropertyMojo
public AbstractExecSetPropertyMojo()
-
-
Method Details
-
getPropertyName
Get the name of the property to set.- Returns:
- the name of the property to set
-
executeAndSetProperty
protected void executeAndSetProperty(File directory, List<String> command) throws MojoExecutionException Execute command and set the property from standard output.- Parameters:
directory- new process current working directory, or null to inheritcommand- command and parameters- Throws:
MojoExecutionException- if execution fails
-
isNonEmpty
-