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
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).
Note that using the
ant property requires Java 8, as the included Ant version was compiled for Java 8.- Since:
- 1.1
- Author:
- Keegan Witt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether to allow System.exit() to be used.protected booleanWhether to add all properties fromproject.propertiesinto properties.protected booleanWhether to add all properties fromsession.userPropertiesinto properties.protected booleanWhether to bind each property to a separate variable (otherwise binds properties to a single 'properties' variable).protected booleanWhether to add user session properties fromsession.userPropertiesthat override project properties into properties.protected IncludeClasspathWhat classpath to include.protected org.apache.maven.project.MavenProjectHelperMaven ProjectHelper to use in properties.protected PropertiesProperties 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_1_8, JAVA_12, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, sessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidInitializes the properties field.protected voidLogs errors that caused the 'ant' object to not be populated.Methods inherited from class org.codehaus.gmavenplus.mojo.AbstractGroovyMojo
getJavaVersion, getJavaVersionString, groovyAtLeast, groovyIs, groovyNewerThan, groovyOlderThan, groovyVersionSupportsAction, isGroovyIndy, isJavaSupportIndy, isJavaSupportParameters, isJavaSupportPreviewFeatures, logPluginClasspath, setupClassWranglerMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
projectHelper
@Component protected org.apache.maven.project.MavenProjectHelper projectHelperMaven ProjectHelper to use in properties.- Since:
- 1.3
-
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 (if groovy.ant.AntBuilder or groovy.util.AntBuilder is available).
- Since:
- 1.0-beta-3
-
allowSystemExits
@Parameter(defaultValue="true") protected boolean allowSystemExitsWhether to allow System.exit() to be used. Should not be set tofalsewhen using parallel execution, as it isn't thread-safe.- Since:
- 1.2
-
bindPropertiesToSeparateVariables
@Parameter(defaultValue="true") protected boolean bindPropertiesToSeparateVariablesWhether to bind each property to a separate variable (otherwise binds properties to a single 'properties' variable).- Since:
- 1.2
-
includeClasspath
What classpath to include. One of- PROJECT_ONLY
- PROJECT_AND_PLUGIN
- PLUGIN_ONLY
- Since:
- 1.8.0
-
bindAllProjectProperties
@Parameter(defaultValue="false") protected boolean bindAllProjectPropertiesWhether to add all properties fromproject.propertiesinto properties.- Since:
- 1.10.1
-
bindSessionUserOverrideProperties
@Parameter(defaultValue="false") protected boolean bindSessionUserOverridePropertiesWhether to add user session properties fromsession.userPropertiesthat override project properties into properties.bindAllSessionUserPropertiestakes priority over this property if present. Has no effect ifbindAllProjectPropertiesisfalse.- Since:
- 1.10.1
-
bindAllSessionUserProperties
@Parameter(defaultValue="false") protected boolean bindAllSessionUserPropertiesWhether to add all properties fromsession.userPropertiesinto properties. If bothbindAllProjectPropertiesandbindAllSessionUserPropertiesare specified, the session properties will override the project properties, but it will also include properties not present in project properties. To only include user session properties that are also in project properties, usebindSessionUserOverrideProperties.- Since:
- 1.10.1
-
-
Constructor Details
-
AbstractToolsMojo
public AbstractToolsMojo()
-
-
Method Details
-
initializeProperties
protected void initializeProperties()Initializes the properties field. -
logUnableToInitializeAntBuilder
Logs errors that caused the 'ant' object to not be populated.- Parameters:
e- the exception causing the failure
-