Package org.dellroad.stuff.maven
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
public abstract class AbstractExecSetPropertyMojo extends AbstractMojo
Support superclass for mojo's that execute some command and set a property based on the resulting output.
-
-
Constructor Summary
Constructors Constructor Description AbstractExecSetPropertyMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidexecuteAndSetProperty(File directory, List<String> command)Execute command and set the property from standard output.protected abstract StringgetPropertyName()Get the name of the property to set.protected booleanisNonEmpty(String value)-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Method Detail
-
getPropertyName
protected abstract String 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
protected boolean isNonEmpty(String value)
-
-