Issue
Using the maven toolbar on Intelij, I used the "Add maven projects" to add a dependency project to the workspace.
Before making a modification to a code in this dependency, I created a feature branch for the changes.
It appeared to me, that the original (the dependent) project is now on the same branch as the dependency project.
Is that how this suppose to be? Can I have the two projects, each one of it on its different feature branch?
The change I made on the dependency project is much more generic for the change I need to do on the dependent project.
Thanks
Solution
That is not the way you are supposed to work with 2 projects. You should have 1 repository for each project. Then, in the dependency project you can execute
mvn install
to publish the jar to maven repository. Now you can reference it inside the pom.xml of your dependant project.
If you persist in the use of your first approach, to be able to access the dependency project, in the branch of the dependent project you must rebase with the branch of the dependency project so that you can have the code in that branch as well. But I don´t recommend that approach it is messy.
Answered By - Jonad García San Martín