Create module dependency when opening multiple gradle projects with matching group:artifact:version:

I have two separated projects in different repositories
Both project are using gradle build system
Project A has, and project.version=1-SNAPSHOT
Project B has, and project.version=1, and it have gradle dependency to A:a:1-SNAPSHOT
Typycally I want to be able to work with B without cloning A's repo(consider there are many projects like A so it would be a pain). I have jenkins that is building A and uploading it's artifacts to nexus, so everything works fine in this case.

Sometimes I want to do some work that affects both A and B. In this case I clone A and B, open B's project and add A as another gradle project there. I am using (+) button in gradle tab.
Unfortunatelly, when I am doing this, idea do not understand that reference to A:a:1-SNAPSHOT in B is now pointing to attached gradle project and not to snapshot in nexus. So every time I am doing this I have to go to module settings, remove reference to nexus snapshot and add reference to idea module A. And I have to repeat it every time I change something in gradle file and force gradle reimport.

Basically, as I understand Idea have good gradle support for cases when you organize whole project in single repository with root gradle proejct file.
While this is typically suffitient there are lots of cases when such project organisation is not convinient or impossible.
Examples are when part of your projects are delivered to open source(or are forks of other open source projects) or when multiple teams support almost independent components, so putting them all to single repository and keeping them always loaded as soures to IDE is bad idea.

Please sign in to leave a comment.