So I finally got my dependencies working with Grails. Now, how can my IDE, eg IntelliJ or Eclipse, take advantage of it? Or do I really have to manually manage what classes my IDE knows about at "development time"?
If the BuildConfig.groovy
script is setup right (see here), you will be able to code away with vi or your favorite editor without any troubles, then run grails compile
which will resolve and download the dependencies into the Ivy cache and off you go...
If, however, you are using an IDE like Eclipse or IntelliJ, you will need the dependencies at hand while coding. Obviously - as these animals will need them for the "real time" error detection/compilation process.
Now, while it is certainly possible to code with all the classes shining up in bright red all over the place that are unknown to your IDE, it is certainly not much fun...
The Maven support or whatever it is officially called lives happily with the pom file, no extra "jar directory" pointers needed, at least in IntelliJ. I would like to be able to do the same with Grails dependencies.
Currently I am defining them in the BuildConfig.groovy
and additionally I copy/paste the current jars around on my local disk and let the IDE point to it.
Not very satisfactory, as I am working in a highly volatile project module environment with respect to code change. And this situation ports me directly into "jar hell", as my "develop- and build-dependencies" easily get out of sync and I have to manage manually, that is, with my brain...
And my brain should be busy with other stuff...
Thanks! Raoul
P.S: I'm currently using Grails 1.2M4 and IntelliJ 92.105. But feel free to add answers on future versions of Grails and different, future IDEs, as the come in...
If you have Eclipse with Grails plugin just run: Grails Tools->Refresh Dependencies (actually I have tried this with STS).
This is fixed in the latest EAP build: 94.173 -> http://youtrack.jetbrains.net/issue/IDEA-50459#content-tab=1
Download it here: http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP
Grails 1.2.1 and IntelliJ Build# 93.94 (version 9.0.1) and I have the same problem. The only way I've gotten it to work is with manually adding the libraries from my maven projects (Under ~/.ivy2/) Otherwise, download the EAP build listed above.
Further, grails integrate-with --intellij does not work. And, in fact, leads to worse problems. The built-in integration in IntelliJ is much better than what grails gives you.
Did you try
grails integrate-with --intellij
At least in 1.2.0RC1 this creates the intellij project files - but I'm not sure if the dependencies are also managed by this one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With