org.apache.maven.shared.scriptinterpreter
Interface ScriptInterpreter
- All Known Implementing Classes:
- BeanShellScriptInterpreter, GroovyScriptInterpreter
public interface ScriptInterpreter
Defines a simple abstraction used to plug-in several script interpreters for the pre-/post-build-hooks. Each
interpretator implementation should be stateless and support reuse.
- Version:
- $Id: ScriptInterpreter.java 1194928 2011-10-29 16:37:19Z olamy $
- Author:
- Benjamin Bentmann
evaluateScript
Object evaluateScript(String script,
List<String> classPath,
Map<String,? extends Object> globalVariables,
PrintStream scriptOutput)
throws ScriptEvaluationException
- Evaluates the specified script.
- Parameters:
script
- The script contents to evalute, must not be null
.classPath
- The additional class path for the script interpreter, may be null
or empty if only
the plugin realm should be used for the script evaluation. If specified, this class path will precede
the artifacts from the plugin class path.globalVariables
- The global variables (as a mapping from variable name to value) to define for the script,
may be null
if not used.scriptOutput
- A print stream to redirect any output from the script to, may be null
to use
stdout/stderr.
- Returns:
- The return value from the script, can be
null
- Throws:
ScriptEvaluationException
- If the script evaluation produced an error.
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.