I'm confused how to structure my pom.xml when both Parent and Child modules are being developed simultaneously

Let's say I have the following maven projects. UtilsLibrary -- A maven project containing utils. AppA -- A maven project that depends on UtilsLibrary. AppB -- A maven project that depends on UtilsLibrary. Please also assume that all 3 of these projects must have the EXACT SAME RELEASE CADENCE. So, all 3 projects are planning to deploy version 123 on March 20. That means that, for now, they are actively being developed, and are deploying their changes to SNAPSHOT versions of 123 at SomeRepo. Now, structuring my pom's for this is easy -- simply have AppA and AppB have a to 123.SNAPSHOT of UtilsLibrary. Simple enough. But when it comes time to release, the best solution I have found is to just manually edit the pom files and change all the SNAPSHOT versions to RELEASE versions, doing my builds, and then deploying UtilsLibrary first, and then doing the other 2 immediately after. Is this the proper way to do this sort of thing? Is there a better way? It feels weird, and wrong. It's almost like the relationship between my UtilsLibrary and my 2 applications is not truly being represented, and it's only by knowing what to edit that I am getting things to work. I almost feel like I should be adding something to say "These 3 projects are being developed together, and therefore, their SNAPSHOT/RELEASE status should be mirrored". If that makes any sense. Lastly, when structuring answers, please help me use the proper terminology. As you can see, my question depends on "fluffy", hard-to-grasp definitions, and depends on context to get the point across. That's part of the reason why my title (as of now) is so poor -- I lack the verbiage to explain it any better.

Mar 13, 2025 - 03:15
 0
I'm confused how to structure my pom.xml when both Parent and Child modules are being developed simultaneously

Let's say I have the following maven projects.

  • UtilsLibrary -- A maven project containing utils.
  • AppA -- A maven project that depends on UtilsLibrary.
  • AppB -- A maven project that depends on UtilsLibrary.

Please also assume that all 3 of these projects must have the EXACT SAME RELEASE CADENCE. So, all 3 projects are planning to deploy version 123 on March 20. That means that, for now, they are actively being developed, and are deploying their changes to SNAPSHOT versions of 123 at SomeRepo.

Now, structuring my pom's for this is easy -- simply have AppA and AppB have a to 123.SNAPSHOT of UtilsLibrary. Simple enough.

But when it comes time to release, the best solution I have found is to just manually edit the pom files and change all the SNAPSHOT versions to RELEASE versions, doing my builds, and then deploying UtilsLibrary first, and then doing the other 2 immediately after.

Is this the proper way to do this sort of thing? Is there a better way? It feels weird, and wrong. It's almost like the relationship between my UtilsLibrary and my 2 applications is not truly being represented, and it's only by knowing what to edit that I am getting things to work.

I almost feel like I should be adding something to say "These 3 projects are being developed together, and therefore, their SNAPSHOT/RELEASE status should be mirrored". If that makes any sense.

Lastly, when structuring answers, please help me use the proper terminology. As you can see, my question depends on "fluffy", hard-to-grasp definitions, and depends on context to get the point across. That's part of the reason why my title (as of now) is so poor -- I lack the verbiage to explain it any better.