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 Details

    • AbstractExecSetPropertyMojo

      public AbstractExecSetPropertyMojo()
  • Method Details

    • 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 inherit
      command - command and parameters
      Throws:
      MojoExecutionException - if execution fails
    • isNonEmpty

      protected boolean isNonEmpty(String value)