问题
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