Create Grails application from existing code
If you already have a Grails project, you can create a IntelliJ IDEA Grails Application around its source code. IntelliJ IDEA recognizes the structure and creates the Grails project view.
If you work with Grails 3 then you can simply import your project for the Gradle model since Grails 3 uses the Gradle build system.
For Grails 1 / 2 use the following procedure:
Launch the New Project wizard. If no project is currently opened in IntelliJ IDEA, click Import Project on the Welcome screen. Otherwise, select from the main menu.
In the dialog that opens, select your Grails project and click OK.
On the next page of the wizard, select Create project from existing sources and click Next.
On the next page of the wizard, select Create project from existing sources and click Next.
On the next page of the wizard, specify the name and the location of your Grails project and click Next.
On the next page of the wizard, select the source roots that you want to include in your project and click Next.
On the next page of the wizard, select the libraries that will be included in your project and click Next.
On the next page of the wizard, review the module structure and dependencies that will be added to the project and click Next.
On the next page of the wizard, select the project SDK and click Next.
On the next page of the wizard, IntelliJ IDEA displays frameworks if they were detected. Click Finish.
IntelliJ IDEA opens a Grails project with its dedicated structure. At this point if IntelliJ IDEA detects a Gradle build tool inside your project, the popup message suggesting to import the Gradle project will be displayed.