Grails Programmer : How to open Grails 3 App with IntelliJ?

Lets assume you already have a folder which contains a Grails 3 app. For example you cloned a Grails 3 project from a git repository or you created an app from scratch with the grails create-app command.

Open IntelliJ and choose Open.

Choose the folder where the Grails 3 app is located.

Go ahead and tell IntelliJ to use the Gradle Wrapper. If you do so, the IDE will use the Gradle wrapper and you will not even need to have Gradle installed.

4 thoughts on “Grails Programmer : How to open Grails 3 App with IntelliJ?”

There seems to be some steps missing in the guide, between “choose folder” and “… Gradle wrapper”, I have yet to see IDEA recognize the Grails 3 project structure and support ex. integration-test, debugging etc.

In IntelliJ IDEA 2017.3.4 (Ultimate Edition): File -> New -> Module from existing sources ->
after i click Open and have chosen the Grails 3 module folder, I’m presented with

Choosing “Create module from existing sources” seems to recognize the source-directories and wrappers – but I’m unable to run or debug any Grails 3 code from inside IDEA.
(Grails 2 works as expected, except the wrapper isn’t utilized)

@Sergio, the Guide above works fine for Grails 2, ie. selecting the root directory is crucial for getting IDEA to recognize a Grails 2 module.

Turns out Grails detection in IDEA is a bit counter-intuitive, but if you’re aware of IDEAs quirks in this regard, it’s possible to import existing Grails modules without IDEA creating a useless mess of “modules” an “libraries” after “import”.

But in-order to get IDEA to recognize a Grails 3 module; the build.gradle file must be selected instead – that seems to get IDEA to recognize the Grails 3 (gradle) structure and support debugging etc.