@Mojo(name="execute",
requiresDependencyResolution=TEST,
threadSafe=true)
public class ExecuteMojo
extends AbstractToolsMojo
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
continueExecuting
Whether to continue executing remaining scripts when a script fails.
|
protected static Version |
GROOVY_1_7_0
Groovy 1.7.0 version.
|
protected static Version |
GROOVY_4_0_0_RC_1
Groovy 4.0.0-RC-1 version.
|
protected String[] |
scripts
Groovy scripts to run (in order).
|
protected boolean |
skipScriptExecution
Flag to allow script execution to be skipped.
|
protected String |
sourceEncoding
The encoding of script files/URLs.
|
protected int |
urlConnectionTimeout
The timeout to use for URL connections.
|
protected int |
urlReadTimeout
The timeout to use for URL reading.
|
allowSystemExits, bindAllProjectProperties, bindAllSessionUserProperties, bindPropertiesToSeparateVariables, bindSessionUserOverrideProperties, includeClasspath, projectHelper, propertiesclassWrangler, GROOVY_1_5_0, GROOVY_SOURCES_PATTERN, JAVA_1_7, JAVA_1_8, JAVA_12, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, session| Constructor and Description |
|---|
ExecuteMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecute()
Does the actual execution.
|
void |
execute()
Executes this mojo.
|
protected void |
executeScriptFromUrl(Class<?> groovyShellClass,
Object shell,
String script)
Executes a script at a URL location.
|
protected void |
executeScripts(Class<?> groovyShellClass,
Object shell)
Executes the configured scripts.
|
protected Object |
setupShell(Class<?> groovyShellClass)
Instantiates a new groovy.lang.GroovyShell object.
|
initializeProperties, logUnableToInitializeAntBuildergetJavaVersion, getJavaVersionString, groovyAtLeast, groovyIs, groovyNewerThan, groovyOlderThan, groovyVersionSupportsAction, isGroovyIndy, isJavaSupportIndy, isJavaSupportParameters, isJavaSupportPreviewFeatures, logPluginClasspath, setupClassWranglerprotected static final Version GROOVY_4_0_0_RC_1
protected static final Version GROOVY_1_7_0
@Parameter(required=true,
property="scripts")
protected String[] scripts
URL to a script
(local or remote), or a filename.@Parameter(defaultValue="false",
property="continueExecuting")
protected boolean continueExecuting
@Parameter(defaultValue="${project.build.sourceEncoding}")
protected String sourceEncoding
@Parameter(defaultValue="false",
property="skipScriptExecution")
protected boolean skipScriptExecution
@Parameter(defaultValue="0",
property="urlConnectionTimeout")
protected int urlConnectionTimeout
@Parameter(defaultValue="0",
property="urlReadTimeout")
protected int urlReadTimeout
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - If an unexpected problem occurs (causes a "BUILD ERROR" message to be displayed)protected void doExecute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - If an unexpected problem occurs (causes a "BUILD ERROR" message to be displayed)protected Object setupShell(Class<?> groovyShellClass) throws InvocationTargetException, IllegalAccessException, InstantiationException, ClassNotFoundException
groovyShellClass - the groovy.lang.GroovyShell classInvocationTargetException - when a reflection invocation needed for shell configuration cannot be completedIllegalAccessException - when a method needed for shell configuration cannot be accessedInstantiationException - when a class needed for shell configuration cannot be instantiatedClassNotFoundException - when a class needed for shell configuration cannot be foundprotected void executeScripts(Class<?> groovyShellClass, Object shell) throws InvocationTargetException, IllegalAccessException, org.apache.maven.plugin.MojoExecutionException
groovyShellClass - the groovy.lang.GroovyShell classshell - a groovy.lag.GroovyShell objectInvocationTargetException - when a reflection invocation needed for script execution cannot be completedIllegalAccessException - when a method needed for script execution cannot be accessedorg.apache.maven.plugin.MojoExecutionException - when an exception occurred during script execution (causes a "BUILD ERROR" message to be displayed)protected void executeScriptFromUrl(Class<?> groovyShellClass, Object shell, String script) throws IOException, InvocationTargetException, IllegalAccessException
groovyShellClass - the GroovyShell classshell - a groovy.lag.GroovyShell objectscript - the script URL to executeIOException - when the stream can't be opened on the URLInvocationTargetException - when a reflection invocation needed for script execution cannot be completedIllegalAccessException - when a method needed for script execution cannot be accessedCopyright © 2011–2025. All rights reserved.