Setting up a Grails 1.1 app with plugin dependencies in IntelliJ
I am using IntelliJ 8.1.2 on Windows to develop a Grails 1.1 project that depends on internal plugins that are not available in the central Grails plugin replica. In Grails 1.1, the default location of installed plugins has been moved from $PROJECT_ROOT/plugins
to$HOME/.grails/1.1/$PROJECT/plugins
Using the command line, I installed my plugins in the default folder. My IntelliJ project contains the main Grails application as a module, and in order for IntelliJ to find the plugins that the main application depends on, I added $HOME/.grails/1.1/$PROJECT/plugins
as the content root and specified which source folders are inside that location.
The project is building and I can run tests with the IDE, but the problem is that plugin projects are not configured as modules within the project - remember this is the installation location for plugins that are installed as content root. So when everything is fine, if I need to change the plugin, I have to do it outside of the IDE and reinstall the plugin via the command line. I'd ideally like the main Grails application and plugins to be configured as modules inside an IntelliJ project, but the main Grails application links to the plugins from their installed location. This will allow me to change the plugins or main application in the IDE, but the versions of the plugins that the main application depends on the IDE will be the same as on the command line (i.e. B $HOME/.grails/1.1/$PROJECT/plugins
). Is there a way to achieve this setting?
a source to share
I think this will be resolved in v8.1.3 as shown in the EAP build. http://www.jetbrains.net/confluence/display/IDEADEV/Diana+EAP
a source to share
You can complete this setup in two steps.
1) Add external plugin content in the root directory of your module
Right click on the module root and select "Module Settings". You are on the Sources tab. Click the Add Root Content button and select $ HOME / .grails / 1.1 / $ PROJECT / plugins. Now, in the folder tree on the right, select the shared groovy file folders and mark them as Sources by clicking on the top button. Example: / grails-app / [conf, services, domain ...] and / src / [groovy, java ..]. Your module will now recognize these sources in the code sentence.
2) Add JAR dependencies of external plugins in module dependencies
Now go to the "Dependencies" tab. Select Grails User Library and click Modify. Then, for each external plugin that has jar dependencies (lib folder), you must click Attach JAR Directories and select HOME / .grails / 1.1 / $ PROJECT / plugins / lib. Your module now recognizes jar dependencies and you can run your application with make or another tool to check for dependencies.
Hope it helps, Wans
a source to share