Irina has posted 29 posts at DZone. View Full User Profile

Easy Grails with IntelliJ IDEA

  • submit to reddit
This post opens a series of articles related to Groovy and Grails development with IntelliJ IDEA 8. Today we’ll discuss some general enhancements that IntelliJ IDEA has introduced to Grails support. While working with the Grails framework in IntelliJ IDEA, you don’t need to care about the complicated structure of a Grails project: IntelliJ IDEA now provides a special module type named “Grails Application”:









A Grails Application is created with all the necessary infrastructure and artifacts required by the Grails specification:















Populate your Grails Application with the Grails elements as usual, using context menu:






You don’t need to care about capitalization and proper placement of the new elements: IntelliJ IDEA generates elements’ names with correct capitalization, and automatically places the new elements to the corresponding folders under the grails-app directory. For example, if you create a Grails domain class, it will be added to the domain folder, a Grails controller will be added to the controllers folder, etc.:










Once a Grails element is created, it is supplied with scaffolding, which can be used for two purposes:

  • Generate new elements:





  • Navigate through the existing ones:





IntelliJ IDEA features an easy way to run Grails targets: press Ctrl+Alt+G and specify the desired target in the Run Grails target dialog box. Note that code completion is available here: start typing the goal name, and press Ctrl+Space:










All output messages are sent to the console:









In the further posts, we’ll look deeper into Grails plugins management, building Grails applications, explore some Groovy and Grails subtleties, and more. Stay tuned.


Published at DZone with permission of its author, Irina Megorskaya.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Thierry Milard replied on Fri, 2008/12/05 - 11:05am

(out of subect)

thanks for the Information.

I love Intellij IDEA. Really I could not switch to others I tried. But I do not use grail yet.

but now I have a problem : I have been testing the (good I think) javaFx API. But I can't use it with my favorite IDE.

If Intelli' nice people would have a good javaFx integration (plugin ?...) It would be great.


Bob Jones replied on Tue, 2008/12/09 - 12:13pm

Awesome series--I'm really excited for this. I recently bought IntelliJ 8, and I LOVE Groovy/Grails.

Perhaps it would be helpful to write about how to configure Grails in IntelliJ at some point, too ;) Even though it's not a lot, it could be helpful for newbies, which seems to be your intended audience.


Roger Studner replied on Tue, 2009/05/19 - 8:31am

Grails 1.1.1 and Intelilj, at the moment, do not work together.


I can create an app, that I can run fine from the command line.

But the default run target does "nothing".  I mean, it runs an app engine server.. but it just returns:

"Place your content here"

Versus showing my index.gsp or any other work i've done.



Chetan Sharma replied on Fri, 2012/09/28 - 9:00am

i have install intelliJ 11.1.3 in windows and i am trying to add grails framework but it not working.
at command promt all grails command working.

after adding grails it showing me folder structure of grails not jar files.