We have 2 java multi-module (composite) projects (that lie in 2 repositories) built using Gradle and maven. The Gradle project depends on the maven project and we need to get the changes from the maven project reflected in Gradle project. Gradle project is referring to the maven project via local maven repo using repositories > mavenLocal > content filtering. (Even though Gradle discourage referring to mavenLocal, we don't have a better option here)
repositories {
mavenLocal {
content {
includeGroupByRegex "REGEX"
}
}
maven {
url "REPO_URL"
}
}
The changes maven project is reflected in gradle project when we performed a Gradle build via command.
We can open both maven and Gradle projects in IntelliJ IDEA as well. But when browsing the source (just assume Gradle project implements an interface from the Gradle project, and when we clicked on the interface in the implemented class declaration of Gradle project) it points to the class from the sources jar in local maven repo. Is there a way that we can configure IDEA to point to the exact source on the maven project which has been already imported in IDE.
Please note following:
- The Gradle project refers to the exact SNAPSHOT of the maven project
- Using IntelliJ IDEA 2019.1.3 (Community Edition)