Reputation: 2200
I'm a bit confused about what is the right way to handle modules versioning in a Maven multi-module project. Let me introduce the structure of a fake project to explain my doubts :
parent
- libs
- lib1
- lib2
- batches
- batch1
- batch2
Add to this the fact that batch1 has a dependency on lib1, and batch2 on lib2. All these modules are in version 1.0.0. I'm working on a new 1.0.1 version. The only module that has to change in this version is lib1. batch1 does not need to implement these changes until version 1.0.2.
The question is : what modules should move to version 1.0.1-SNAPSHOT ?
My answer would be : lib1, libs and parent. Those are the only modules that actually changed (if we consider that parent modules "contain" their children's code) But some modules would remain children of the obsolete parent 1.0.0, which doesn't sound right.
What would you recommand?
Upvotes: 4
Views: 886
Reputation: 7940
There is no global standard for this, it all depends on your requirement.
So if you have 100 modules then you not release all of them with every release which implies components will be on different versions.
But if you have a small set then you can always upgrade components to new version even if their is no change. In this scenario, you can manage version just by using parent pom version.
EDIT:
As mentioned by OP that he has hunderds of modules, in this case each module should have its own version in its pom. It will not be feasible to keep them at same version all the time. And this is followed in many orgs and projects.
Upvotes: 2