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 String[] |
scripts
Groovy scripts to run (in order).
|
protected String |
sourceEncoding
The encoding of script files.
|
allowSystemExits, bindPropertiesToSeparateVariables, projectHelper, properties
classWrangler, GROOVY_1_5_0, GROOVY_SOURCES_PATTERN, JAVA_1_7, JAVA_SOURCES_PATTERN, minGroovyVersion, mojoExecution, pluginArtifacts, project, session, skipTests
Constructor and Description |
---|
ExecuteMojo() |
Modifier and Type | Method and Description |
---|---|
protected void |
doExecute()
Does the actual execution.
|
void |
execute()
Executes this mojo.
|
protected void |
executeScripts(Class groovyShellClass,
Object shell)
Executes the scripts using the GroovyShell.
|
protected Object |
setupShell(Class groovyShellClass)
Creates the GroovyShell shell to use to execute scripts.
|
initializeProperties, logUnableToInitializeAntBuilder
getJavaVersion, getJavaVersionString, groovyVersionSupportsAction, isJavaSupportIndy, logPluginClasspath
protected String[] scripts
URL
to a Groovy script (local or remote).protected boolean continueExecuting
protected String sourceEncoding
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
- If an unexpected problem occurs. Throwing this exception causes a "BUILD ERROR" message to be displayedorg.apache.maven.plugin.MojoFailureException
- If an expected problem (such as a compilation failure) occurs. Throwing this exception causes a "BUILD FAILURE" message to be displayedprotected void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
- If an unexpected problem occurs. Throwing this exception causes a "BUILD ERROR" message to be displayedorg.apache.maven.plugin.MojoFailureException
- If an expected problem (such as a invocation failure) occurs. Throwing this exception causes a "BUILD FAILURE" message to be displayedprotected Object setupShell(Class groovyShellClass) throws InvocationTargetException, IllegalAccessException, InstantiationException
groovyShellClass
- the GroovyShell classInstantiationException
- when a class needed for script execution cannot be instantiatedIllegalAccessException
- when a method needed for script execution cannot be accessedInvocationTargetException
- when a reflection invocation needed for script execution cannot be completedprotected void executeScripts(Class groovyShellClass, Object shell) throws InvocationTargetException, IllegalAccessException, org.apache.maven.plugin.MojoExecutionException
groovyShellClass
- the GroovyShell classshell
- the shell to use for script executionIllegalAccessException
- when a method needed for script execution cannot be accessedInvocationTargetException
- when a reflection invocation needed for script execution cannot be completedorg.apache.maven.plugin.MojoExecutionException
- when an error occurs during script executionCopyright © 2011–2022. All rights reserved.