Saturday, February 7, 2009

Importing Grails project into IntelliJ IDEA

I prefer IntelliJ IDEA as my Integrated Development Environment (IDE). Currect IDEA version is 8.0.*.
After You've created Your Grails project using
grails create-app application_name
please follow few simple steps to import newly created project to IntelliJ IDEA:
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Before proceeding make sure that your project uses appropriate JDK. Click File > Project Structure and check the value in Project SDK combobox.
  6. 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.

No comments:

Post a Comment