After You've created Your Grails project using
grails create-app application_nameplease follow few simple steps to import newly created project to IntelliJ IDEA:
- Check that file
application_name/.project is created. This is the Eclipse project file generated by grails create-app command during the initial project creation. IntelliJ IDEA is capable of opening such files and transforming them into IntelliJ IDEA project files.
- Start IntellIJ IDEA, click File > Open Project ... menu item and specify .project file as target. IntelliJ IDEA will process the file and will create project, module and workspace files.
- Next you need to tell IntelliJ IDEA to enable Grails support. It may be achieved by registering Grails facet for the project. Intellij IDEA may detect the facet itself and ask to register it. In case it will not, you have to do it manually.
- In order to manually register Grails facet open the context menu for your module item in project explorer and click on Module Settings. On the Project Structure window click + button and choose Grails facet. Then just apply the settings and close the window. Module icon will be updated with Grails facet icon - this will tell you that project module is Grails-ready.
- Before proceeding make sure that your project uses appropriate JDK. Click File > Project Structure and check the value in Project SDK combobox.
- Click Build > Rebuild Project to compile the sources - this step should be successfull, otherwise there is a trouble with your setup or source code base is broken.