Friday
May022008
Setting up the IntelliJ Plugin for Groovy and Grails
Friday, May 2, 2008 at 5:49AM The IntelliJ plugin is a great tool. However, one important thing to note is that it wants the source distribution of grails in the grails directory. Why? Because the GSP support requires the source code for the GSP tags.
Plugin Setup Process
In order to properly set up the Grails plugin, do the following:
- Download the grails source code zip file (which also contains the binary)
- Unzip the source code distribution
- Download the Groovy source and binary code distributions. Since the source release does not include a built binary, I had to download both the source and binary distributions and merge them together (building on my OS X machine failed). YMMV.
- Open IntelliJ Idea, go to the Preferences / Plugins page, and download JetGroovy and install it
- Restart Idea
- Open the Preferences / Plugins page again, and select Groovy
- Set the folder locations for Groovy and Grails to your new directories
There, that's it. Now, you can create Groovy and Grails projects, debug Groovy code, and use the Apple/Ctrl click trick to jump into Groovy or Grails source code.
GSP Tags
GSP tags are closures, so the plugin can't figure out attributes. That's ok, if you want to see more information, just CTRL or Apple click on the GSP tag name, and it will jump to the source code of the tag closure in the editor.
Ken Rimple |
2 Comments | tagged
grails,
groovy,
idea in
Groovy/Grails,
Technologies
grails,
groovy,
idea in
Groovy/Grails,
Technologies 

Reader Comments (2)
I also find it useful to go into the Preferences->Debugger panel. On the "General" tab, there is a list of class package patterns that we don't want the debugger to step into. I hit add pattern and enter:
groovy.lang.*
org.codehaus.groovy.*
Grails/groovy stacktraces are very deep, and adding these two patterns makes it much less painful and much easier to concentrate on debugging your code rather that framework code.
Ted: Great tip. Thank you!