Grails ant tasks do not work - unable to start Grails: java.lang.reflect.InvocationTargetException

I'm having trouble getting something that seems very simple with Grails. I want to call the grails commands from an Ant script - Grails does the Grails task to achieve this. I defined Grails tasks taskdef and classpaths according to the docs, however, no matter which command I call, I get the same error ...

grails-compile:
   [grails] Resolving dependencies...
   [grails] Dependencies resolved in 1192ms.

BUILD FAILED
/java/grailstest/build.xml:22: Unable to start Grails: java.lang.reflect.InvocationTargetException

Even when I create a new Grails application using "grails create-app" and then run the Ant command "grails integrate-with - ant" to generate the default build.xml, I get the same when I run any of the tasks in the generated file build.xml.

I tested this with Grails 1.3.1, 1.3.4 and 1.3.5 and get the same error.

Has anyone else encountered this problem? It must be something stupid I'm doing wrong, or it would never have done it outside the door of the Grails factory ...;)

+3
source share
2 answers

I forgot to mention that I am using Ant version 1.8.1. I just discovered that switching to Ant 1.7.1 "solves" this problem, but it is not quite the way I need 1.8.1 for other build tasks. I will send an error to the Grails tracker, as it seems that many people have the same problem.

+2
source

I just found the same problem. It seems that Ant 1.8 is not yet supported (but Ant 1.7 is), see GRAILS-6897 . Some users have complained that this is not explicitly stated in the documentation.

+1

Source: https://habr.com/ru/post/1770752/


All Articles