我编写了自己的 gant 脚本,可以在命令行中正常工作。现在我需要从这样的 grails 项目中运行这个脚本:
def outputMessage
try{
GroovyScriptEngine engine = new GroovyScriptEngine("/www", this.getClass().getClassLoader());
engine.run("scripts/MyOwnScript_.groovy", "param1 param2")
outputMessage = "<br> OK: Script run successfully"
}
catch (Exception e) {
outputMessage += "<br> ERROR: There has been running the script"
}
我得到的错误是“没有这样的属性:类的 includeTargets:MyOwnScript_”,因为我的 gant 脚本需要一些其他脚本。
有人知道让它工作的正确方法吗?