Intellij IDEA Gradle source dir with Liferay
Hello,
I am facing a problem with my IDE. I use Liferay DXP on my project in my company and I'd like to have the source attached for better debugging. But there is a problem ; since the project dependency manager is gradle, all the source are tied to gradle. What I mean by that is simple ; whenever I try to debug or just access the source of a Liferay DXP Class, it is opening the gradle source jar, located in the gradle cache.
My problem is that I don't want Intellij to open the gradle class source. I want it to open the Liferay Source folder instead. I tried to add the whole Liferay src folder into a global library and then add the newly created library into my project (Module => Dependencies) but it still opening the gradle-cache src instead of the provided one. In other terms ... How I can tell Intellij "At compile time, STOP looking into gradle cache for class sources and look instead into THIS folder (Liferay src) for libraries source"? Keeping in mind that I have numerous modules (portlets) with a build.gradle file for each, with dependencies etc.
Thank you very much!
Cheers.
Please sign in to leave a comment.
IDE will resolve the dependency as a module dependency (rather than to the library jar file) in a Gradle project if this dependency is configured not as a library but as a Gradle project dependency.
I.e. if you have sources for module B and use it in module C, you set it up as a multi module Gradle project like so http://devnet.jetbrains.com/message/5511277#5511277 . Then the dependency on module B would be set up of a
moduletype http://www.jetbrains.com/idea/webhelp/dependencies.html and navigate to this module sources will be available. Please review also http://www.gradle.org/docs/current/userguide/multi_project_builds.html .