I have the following directory structure
--my-app
|
|--main-app
|
|--plugins
|
|--plugin1
|
|--plugin2
In grails-app/conf/BuildConfig I've added the necessary configuration to ensure that the plugins are loaded from the plugins
directory, so that when I run the application, it picks up the most recent changes.
I'm trying to set this up as a single project in IntelliJ which has 3 modules, one for the main application and one for each of the two plugins. I tried the following:
Generate the IntelliJ project files
cd my-app/main-app
grails integrate-with --intellij
Open the generated .ipr file from inside Intellij (File | Open Project...). This adds the main application and plugins as Grails modules
However every time I open a class from a plugin, IntelliJ reports that the class has two occurrences. It seems each plugin class is being detected
main-app-grailsPlugins
In the project structure view I tried removing the content roots for plugin1
and plugins2
from main-app-grailsPlugins
, but they get automatically added back again.
Is there a way to prevent this, or some other way of correctly setting up an IntelliJ project for a Grails app with in-place plugins. I'm using Grails 1.3.7 and IntelliJ 10.5.4
With IntelliJ IDEA 12 Ultimate this is very easy:
"File" --> "Import Project..." --> select your grails application, "OK" --> Select "Create project from existing sources", "Next" --> "Next" --> "Next" --> Select JDK, "Next" --> Select grails version, "Next" --> "Finish"
The inplace plugins will automatically be added as modules. Result: http://d.pr/i/YHkk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With