IntelliJ IDEA 2017 - for Grails 3 multi module project
All,
I have a multi-module (each module contains the gsp files inside the same module, so that they can be used as individual plugins) Grails3 project using version 3.1.16, build on Gradle distribution.
I imported the parent project which contains the settings.gradle that has all the plugins needed to be included.
When I run the main application, the application is starting up. But I have the below 2 issues:
1. The RequestDispatcherServlet is unable to resolve the pages (.gsp files ) present in the plugins.
2. The main application fetches the plugins as jars not as source code i.e resources ( .groovy) files. Due to this, any changes made to files in plugins are not being picked up at compile time.
PS: I am new to IntelliJ, using a IntelliJ IDEA Ultimate edition - trial version.
Any help, highly appreciated.
Thanks
Please sign in to leave a comment.
If the issue is IntelliJ IDEA specific and your project works fine from the command line Gradle/Grails, please file an issue at https://youtrack.jetbrains.com/issues/IDEA and attach a small sample to reproduce.
Hi Serge Baranov,
Thanks for responding. The project works fine on command line. I would raise an issue at the link you have mentioned.
Hi Serge,
The issue have now been resolved. I was earlier adding the plugins as dependencies in build.gradle. On changing it to the below worked. (For a sample project I created, to send a post as you suggested)
My current project has multiple modules with the below project structure:
|MainProject
-|ParentApp
-|build.gradle contains................
-|plugins{
compile project(':plugin1')
compile project(':plugin2')
compile project(':plugin3')
compile project(':plugin4')
}
-|plugin1
-|build.gradle contains................
plugins{
compile project(':plugin2')
compile project(':plugin3')
}
-|plugin2
-|build.gradle contains................
plugins{
compile project(':plugin1')
compile project(':plugin2')
}
It has been set up as such so that it works as a whole application when running application as ParentApp or with certain fragments when running application as either of the applications.
If I am using ParentApp to run-app, is it enough if I change the build.gradle to have the plugins in plugin{} block or do I need to change it for all the plugins i.e adding attribute exploded= true & moving compile project(':anotherProject') from dependencies to plugins block ?