Over a million developers have joined DZone.

Easy Grails with IntelliJ IDEA

· Java Zone

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

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.


Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.


Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}