Fork me on GitHub

gplus:execute

Full name:

org.codehaus.gmavenplus:gmavenplus-plugin:3.0.2:execute

Description:

Executes Groovy scripts (in the pom or external), bound to the current project. Note that this mojo requires Groovy >= 1.5.0. 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).

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 1.0-beta-1.

Required Parameters

Name Type Since Description
<scripts> String[] - Groovy scripts to run (in order). Can be a script body, a URL to a script (local or remote), or a filename.

Optional Parameters

Name Type Since Description
<allowSystemExits> boolean 1.2 Whether to allow System.exit() to be used. Should not be set to false when using parallel execution, as it isn't thread-safe.
Default: true
<bindAllProjectProperties> boolean 1.10.1 Whether to add all properties from project.properties into properties.
Default: false
<bindAllSessionUserProperties> boolean 1.10.1 Whether to add all properties from session.userProperties into properties. If both bindAllProjectProperties and bindAllSessionUserProperties are 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, use bindSessionUserOverrideProperties.
Default: false
<bindPropertiesToSeparateVariables> boolean 1.2 Whether to bind each property to a separate variable (otherwise binds properties to a single 'properties' variable).
Default: true
<bindSessionUserOverrideProperties> boolean 1.10.1 Whether to add user session properties from session.userProperties that override project properties into properties. bindAllSessionUserProperties takes priority over this property if present. Has no effect if bindAllProjectProperties is false.
Default: false
<continueExecuting> boolean - Whether to continue executing remaining scripts when a script fails.
Default: false
<includeClasspath> IncludeClasspath 1.8.0 What classpath to include. One of
  • PROJECT_ONLY
  • PROJECT_AND_PLUGIN
  • PLUGIN_ONLY
Uses the same scope as the required dependency resolution of this mojo. Use only if you know what you're doing.
Default: PROJECT_AND_PLUGIN
<properties> Properties 1.0-beta-3 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).
These can be overridden.
<skipScriptExecution> boolean 1.9.1 Flag to allow script execution to be skipped.
Default: false
<sourceEncoding> String 1.0-beta-2 The encoding of script files.
Default: ${project.build.sourceEncoding}

Parameter Details

<allowSystemExits>

Whether to allow System.exit() to be used. Should not be set to false when using parallel execution, as it isn't thread-safe.
  • Type: boolean
  • Since: 1.2
  • Required: report.plugin.goal.no
  • Default: true

<bindAllProjectProperties>

Whether to add all properties from project.properties into properties.
  • Type: boolean
  • Since: 1.10.1
  • Required: report.plugin.goal.no
  • Default: false

<bindAllSessionUserProperties>

Whether to add all properties from session.userProperties into properties. If both bindAllProjectProperties and bindAllSessionUserProperties are 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, use bindSessionUserOverrideProperties.
  • Type: boolean
  • Since: 1.10.1
  • Required: report.plugin.goal.no
  • Default: false

<bindPropertiesToSeparateVariables>

Whether to bind each property to a separate variable (otherwise binds properties to a single 'properties' variable).
  • Type: boolean
  • Since: 1.2
  • Required: report.plugin.goal.no
  • Default: true

<bindSessionUserOverrideProperties>

Whether to add user session properties from session.userProperties that override project properties into properties. bindAllSessionUserProperties takes priority over this property if present. Has no effect if bindAllProjectProperties is false.
  • Type: boolean
  • Since: 1.10.1
  • Required: report.plugin.goal.no
  • Default: false

<continueExecuting>

Whether to continue executing remaining scripts when a script fails.
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: false

<includeClasspath>

What classpath to include. One of
  • PROJECT_ONLY
  • PROJECT_AND_PLUGIN
  • PLUGIN_ONLY
Uses the same scope as the required dependency resolution of this mojo. Use only if you know what you're doing.
  • Type: org.codehaus.gmavenplus.model.IncludeClasspath
  • Since: 1.8.0
  • Required: report.plugin.goal.no
  • Default: PROJECT_AND_PLUGIN

<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).
These can be overridden.
  • Type: java.util.Properties
  • Since: 1.0-beta-3
  • Required: report.plugin.goal.no

<scripts>

Groovy scripts to run (in order). Can be a script body, a URL to a script (local or remote), or a filename.
  • Type: java.lang.String[]
  • Required: report.plugin.goal.yes

<skipScriptExecution>

Flag to allow script execution to be skipped.
  • Type: boolean
  • Since: 1.9.1
  • Required: report.plugin.goal.no
  • Default: false

<sourceEncoding>

The encoding of script files.
  • Type: java.lang.String
  • Since: 1.0-beta-2
  • Required: report.plugin.goal.no
  • Default: ${project.build.sourceEncoding}