Package org.codehaus.gmavenplus.mojo
Class AbstractToolsMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
-
- org.codehaus.gmavenplus.mojo.AbstractToolsMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
ConsoleMojo,ExecuteMojo,ShellMojo
public abstract class AbstractToolsMojo extends AbstractGroovyMojo
The base tools mojo, which all tool mojos extend. Note that it references the plugin classloader to pull in dependencies Groovy didn't include (for things like Ant for AntBuilder, Ivy for @grab, and Jansi for Groovysh).- Since:
- 1.1
- Author:
- Keegan Witt
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowSystemExitsWhether to allow System.exit() to be used.protected booleanbindPropertiesToSeparateVariablesWhether to bind each property to a separate variable (otherwise binds properties to a single 'properties' variable).protected org.apache.maven.project.MavenProjectHelperprojectHelperMaven ProjectHelper to use in properties.protected PropertiespropertiesProperties to make available in scripts as variables using the property name.-
Fields inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
classWrangler, GROOVY_1_5_0, GROOVY_SOURCES_PATTERN, JAVA_1_7, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, session, skipTests
-
-
Constructor Summary
Constructors Constructor Description AbstractToolsMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinitializeProperties()Initializes the properties field.protected voidlogUnableToInitializeAntBuilder(Throwable e)Logs errors that caused the 'ant' object to not be populated.-
Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
getJavaVersion, getJavaVersionString, groovyVersionSupportsAction, isJavaSupportIndy, logPluginClasspath
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
projectHelper
protected org.apache.maven.project.MavenProjectHelper projectHelper
Maven ProjectHelper to use in properties.- Since:
- 1.3
-
properties
protected Properties properties
Properties to make available in scripts as variables using the property name. By default will include- project
- A org.apache.maven.project.Project object of the current Maven project.
- session
- A org.apache.maven.execution.MavenSession object of the current Maven session.
- pluginArtifacts
- A list of org.apache.maven.artifact.Artifact objects of this plugin's artifacts.
- mojoExecution
- A org.apache.maven.plugin.MojoExecution object of this plugin's mojo execution.
- log
- A org.apache.maven.plugin.logging.Log object of Maven's log.
- ant
- A groovy.util.AntBuilder object.
- Since:
- 1.0-beta-3
-
allowSystemExits
protected boolean allowSystemExits
Whether to allow System.exit() to be used.- Since:
- 1.2
-
bindPropertiesToSeparateVariables
protected boolean bindPropertiesToSeparateVariables
Whether to bind each property to a separate variable (otherwise binds properties to a single 'properties' variable).- Since:
- 1.2
-
-
Method Detail
-
initializeProperties
protected void initializeProperties()
Initializes the properties field.
-
logUnableToInitializeAntBuilder
protected void logUnableToInitializeAntBuilder(Throwable e)
Logs errors that caused the 'ant' object to not be populated.- Parameters:
e- the exception causing the failure
-
-