Package org.codehaus.mojo.buildhelper
Class BeanshellPropertyMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.buildhelper.AbstractDefinePropertyMojo
org.codehaus.mojo.buildhelper.BeanshellPropertyMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="bsh-property",
defaultPhase=VALIDATE,
threadSafe=true)
public class BeanshellPropertyMojo
extends AbstractDefinePropertyMojo
Define one or many properties as a result of a Beanshell script invocation. Like
gmaven-plugin, some variables are
defined:
project
: the actual Maven project,session
: the executingMavenSession
,settings
: the executingSettings
.log
: the logger of the Mojo (seeAbstractMojo.getLog()
).
- Since:
- 1.8
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.maven.execution.MavenSession
The Maven Session.private String[]
List of property names to get from script context after execution.private org.apache.maven.settings.Settings
The Maven Settings.private String
Fields inherited from class org.codehaus.mojo.buildhelper.AbstractDefinePropertyMojo
project
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.codehaus.mojo.buildhelper.AbstractDefinePropertyMojo
defineProperty, getProject
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
source
-
properties
List of property names to get from script context after execution. Can be omitted if no property needs to be defined, just the script execution. -
mavenSession
@Parameter(readonly=true, defaultValue="${session}") private org.apache.maven.execution.MavenSession mavenSessionThe Maven Session. -
settings
@Parameter(readonly=true, defaultValue="${settings}") private org.apache.maven.settings.Settings settingsThe Maven Settings.
-
-
Constructor Details
-
BeanshellPropertyMojo
public BeanshellPropertyMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoFailureExceptionMain plugin execution- Throws:
org.apache.maven.plugin.MojoFailureException
-
set
private void set(bsh.Interpreter interpreter, String name, Object value) throws org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoFailureException
-