带有grails的gant脚本:includeTarget错误 [英] gant script with grails : includeTarget error

查看:66
本文介绍了带有grails的gant脚本:includeTarget错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建gant脚本以从grails(v2.3.4)应用程序编译外部模块:

Creating a gant script to compile external module from a grails (v2.3.4) application:

允许create-script编译

grails create-script compile

代码中的标题如下:

includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsClasspath")
includeTargets << grailsScript("_GrailsRun")

grails运行脚本返回 执行脚本RunScript时出错:无此类属性:类Script1的includeTargets

grails run script returns Error executing script RunScript: No such property: includeTargets for class: Script1

在此问题之前,我有一个与Tomcat插件相关的问题,该问题已通过停用插件以执行脚本得到解决.

Before that issue i had one with Tomcat plugin dependency, which has been resolved by desactivating the plugin so as to execute the script.

欢迎任何帮助.

推荐答案

您如何运行脚本?看来您正在使用 http://grails.org/doc/latest/ref/Command%20Line/run-script.html ,但这不适用于Gant脚本-适用于可以访问应用程序类的简单脚本.参见 http://naleid.com/blog/2010/12/03/grails-run-script-updated-for-grails-1-3-5 有关此问题的原始博客文章.

How are you running the script? It appears that you're using http://grails.org/doc/latest/ref/Command%20Line/run-script.html but that's not for Gant scripts - it's for simple scripts that can access application classes. See http://naleid.com/blog/2010/12/03/grails-run-script-updated-for-grails-1-3-5 for the original blog post about this.

创建Gant脚本时,它会成为常规命令,例如run-appcreate-domain-class等.因此,您应该以身份运行compile脚本

When you create a Gant script, it becomes a regular command like run-app, create-domain-class, etc. So you should be running your compile script as

grails compile

您可能不应该使用与Grails或其他插件所包含的脚本相同的名称命名脚本. Grails会提示您询问是要运行自己的还是现有的,但是这很烦人.如果您只是给它起一个唯一的名字,那将是一个更顺畅的过程.

YOu probably shouldn't name scripts the same as ones included by Grails or other plugins. Grails will prompt you to ask if you want to run yours or the pre-existing one, but that's annoying; if you just give it a unique name it will be a smoother process.

这篇关于带有grails的gant脚本:includeTarget错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆