1

I have a multi module project, with a parent x pom containing all sub projects in its tag.

Most of those have x as their parent, but some are rest servers which use swagger as their parent.

When using commands such as "test" or "deploy" on parent x, those projects are included. But when using the command "mvn versions:set -DnewVersion=XYZ" on parent x, those projects will not be updated. Even "mvn versions:set versions:update-child-modules -DnewVersion=X.Y.Z-SNAPSHOT" will not work

Is there a way to update also the projects with a different parent?

Daniel Töws
  • 347
  • 1
  • 5
  • 21

1 Answers1

0

If there is no inheritance, relation inheritance can simply not take place. You could consider having a separate parent for all rest servers, that itself has swagger as a parent and contains versioning information. This way you only need to update on two locations. Still not optimal, but better than updateing all rest servers manually.

fl0w
  • 3,593
  • 30
  • 34
  • The problem is, that it used to work a few months back. But I can not remember what I may have changed in between. I mean, the inheritance information is stored in the parent pom under and clearly works with test and deploy. Or are you really right and I just did something else then? – Daniel Töws Aug 02 '18 at 12:58
  • 1
    Did you NOT change the parent since then? Because if you not doing magic (see link below) then inheritance is the only way to reach these values. Other solution is reading a properties file: https://stackoverflow.com/questions/14725197/reading-properties-file-from-pom-file-in-maven?rq=1 – fl0w Aug 02 '18 at 13:13
  • 1
    Ok so you were right, it never worked. Before I tried this, somebody else used to it in my company. Since he left I was tasked to do it, but struggled with it. Turns out he did some regex magic to grab the version and insert it into the swagger projects. I will try to think of a solution here. Thank you! – Daniel Töws Aug 02 '18 at 14:00