gant script with grails : includeTarget error

爱⌒轻易说出口 提交于 2019-12-08 09:12:52

问题


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

grails create-script compile

With the header below in the code:

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

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

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

Any help is welcome.


回答1:


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.

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

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.



来源:https://stackoverflow.com/questions/20743084/gant-script-with-grails-includetarget-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!