There are two projects in gitlab:
In project-a, project-a-dependency is a dependency that is connected as:
implementation("my.space:project-a-dependency")
Currently, the development is carried out as follows:
Question: is there any way to open two projects simultaneously in IntelliJ IDEA, change the dependency, rebuild the project and see all the changes? If the answer is yes, then how do I do it?
I tried the following: Project -> Project Structure -> Project Settings -> Modules -> [+] I added the project-a-dependency module and clicked the "apply" button.
Then I added it to build.gradle the line:
implementation project(':project-a-dependency')
I clicked the "Load gradle changes" button and got an error:
Project with path ':project-a' could not be found in root project 'project-a-dependency'.
If I understood you correctly and project-a-dependency is a standalone Gradle project you can achieve this with a composite build.
A module dependency can be substituted by a dependency to a local fork of the sources of that module, if the module itself is built with Gradle.
Add the dependency on project-a-dependency inside your settings.gradle.(kts)
with the help of includeBuild()
function. Included builds are added by location. This will allow you to work with your project-a-dependency as if it were just a module in your current project. Dependency substitution will be handled by Gradle for you.
One thing to note is that since your dependency is local it will have to be compiled instead of just being an available binary
More info: https://docs.gradle.org/current/userguide/composite_builds.html#defining_composite_builds