IntelliJ IDEA 2018.2 Help

Creating 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:

  1. Launch the New Project wizard. If no project is currently opened in IntelliJ IDEA, click Import Project on the Welcome screen. Otherwise, select File | New | Project from Existing Sources from the main menu.

  2. In the dialog that opens, select your Grails project and click OK.

  3. On the next page of the wizard, select Create project from existing sources and click Next.

  4. On the next page of the wizard, select Create project from existing sources and click Next.

  5. On the next page of the wizard, specify the name and the location of your Grails project and click Next.

  6. On the next page of the wizard, select the source roots that you want to include in your project and click Next.

  7. On the next page of the wizard, select the libraries that will be included in your project and click Next.

  8. On the next page of the wizard, review the module structure and dependencies that will be added to the project and click Next.

  9. On the next page of the wizard, select the project SDK and click Next.

  10. 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 pop-up message suggesting to import the Gradle project will be displayed.

Last modified: 20 November 2018

See Also