Chariot Training Classes

Training Courses

I run Chariot's training and mentoring services. We provide training in AngularJS, HTML5, Spring, Hibernate, Maven, Scala, and more.

Chariot Education Services

Technology

Chariot Emerging Tech

Learn about upcoming technologies and trends from my colleagues at Chariot Solutions.

Resources

Chariot Conferences

Podcasts

« Studs - A Struts port to PHP | Main | Grails and Spring WebFlow »
Friday
May022008

Setting up the IntelliJ Plugin for Groovy and Grails

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:

  1. Download the grails source code zip file (which also contains the binary)

  2. Unzip the source code distribution

  3. 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.

  4. Open IntelliJ Idea, go to the Preferences / Plugins page, and download JetGroovy and install it

  5. Restart Idea

  6. Open the Preferences / Plugins page again, and select Groovy

  7. 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.

PrintView Printer Friendly Version

EmailEmail Article to Friend

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.

May 3, 2008 | Unregistered CommenterTed Naleid

Ted: Great tip. Thank you!

May 8, 2008 | Unregistered Commenterkrimple

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>