|
|||||||||
上一课 下一课 | 框架 没有框架 所有类 | ||||||||
摘要:嵌套 | 领域 | 构造 | 方法 | 详细信息:字段 | 构造 | 方法 |
java.lang.Object org.apache.maven.shared.scriptinterpreter.ScriptRunner
public class ScriptRunner
运行构建前/构建后的钩子脚本。
构造函数摘要 | |
---|---|
ScriptRunner(Log log)
创建一个新的脚本运行器。 |
方法总结 | |
---|---|
void |
addScriptInterpreter(String id,
ScriptInterpreter scriptInterpreter)
|
void |
run(String scriptDescription,
File scriptFile,
Map<String,? extends Object> context,
ExecutionLogger logger,
String stage,
boolean failOnException)
运行指定的挂钩脚本。 |
void |
run(String scriptDescription,
File basedir,
String relativeScriptPath,
Map<String,? extends Object> context,
ExecutionLogger logger,
String stage,
boolean failOnException)
运行指定的挂钩脚本。 |
void |
setClassPath(List<String> classPath)
设置挂钩脚本的附加类路径。 |
void |
setGlobalVariable(String name,
Object value)
为脚本解释器设置一个全局变量。 |
void |
setScriptEncoding(String encoding)
设置挂钩脚本的文件编码。 |
从类 java.lang 继承的方法。目的 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造函数详细信息 |
---|
public ScriptRunner(Log log)
log
- 打印诊断信息的 mojo 记录器不能是null
.方法详情 |
---|
public void addScriptInterpreter(String id, ScriptInterpreter scriptInterpreter)
public void setGlobalVariable(String name, Object value)
name
- 变量的名称,不能是null
.value
- 变量的值,可能是null
.public void setClassPath(List<String> classPath)
classPath
null
- 脚本解释器的附加类路径,如果只应使用插件领域进行脚本评估,则可以为或为空。如果指定,则此类路径将位于插件类路径中的工件之前。public void setScriptEncoding(String encoding)
encoding
- 钩子脚本的文件编码,可以是null
或为空以使用平台的默认编码。public void run(String scriptDescription, File basedir, String relativeScriptPath, Map<String,? extends Object> context, ExecutionLogger logger, String stage, boolean failOnException) throws IOException, RunFailureException
scriptDescription
- 用于记录的脚本描述不能是null
.basedir
- 项目的基目录,不能是null
.relativeScriptPath
- 相对于项目基目录的脚本路径,可以null
跳过脚本执行。context
- 用于在挂钩脚本之间共享信息的键值存储可能是null
.logger
- 将脚本输出重定向到的记录器可能是null
使用 stdout/stderr。stage
- 调用脚本的构建作业的阶段不能是null
. 这仅用于记录目的。failOnException
- 如果true
并且脚本抛出异常,则将RunFailureException
抛出a,否则RunErrorException
将抛出脚本异常。
IOException
- 如果在读取脚本文件时发生 I/O 错误。
RunFailureException
- 如果脚本没有返回true
抛出异常。public void run(String scriptDescription, File scriptFile, Map<String,? extends Object> context, ExecutionLogger logger, String stage, boolean failOnException) throws IOException, RunFailureException
scriptDescription
- 用于记录的脚本描述不能是null
.scriptFile
- 脚本的路径,可能是null
跳过脚本执行。context
- 用于在挂钩脚本之间共享信息的键值存储可能是null
.logger
- 将脚本输出重定向到的记录器可能是null
使用 stdout/stderr。stage
- 调用脚本的构建作业的阶段不能是null
. 这仅用于记录目的。failOnException
- 如果true
并且脚本抛出异常,则将RunFailureException
抛出a,否则RunErrorException
将抛出脚本异常。
IOException
- 如果在读取脚本文件时发生 I/O 错误。
RunFailureException
- 如果脚本没有返回true
抛出异常。
|
|||||||||
上一课 下一课 | 框架 没有框架 所有类 | ||||||||
摘要:嵌套 | 领域 | 构造 | 方法 | 详细信息:字段 | 构造 | 方法 |