Joseph Aruja
Joseph Aruja

Reputation: 61

Managing Versions of dependencies

What is best way of managing versions of dependencies?.

Generally I would create a super POM (Not Parent POM) and I would declare all my dependencies in the super POM. So that all my projects can refer that POM for the dependencies. The advantage is that all my dependencies are controlled from a central POM.

But if we are developing some products selling to different clients year after year and also dependencies versions get updated year after year. How will I keep track of my dependency versions of products I released to each client?.. I don't want to keep updating my POM every time a dependency version needs to be updated.

So I was thinking of keeping the version of dependencies in my settings xml as properties and settings can be updated or version-ed per release.

I am experienced in Maven but not an expert. Any good suggestions?... Thanks In Advance Joseph

Upvotes: 0

Views: 315

Answers (1)

ben75
ben75

Reputation: 28746

  • Put all your version in the dependencyManagement of the parent pom. (as you do now, that's why dependencyManagement exists)
  • To keep track of old release : use a tag in SCM.
  • settings.xml in not part of the project! it is there to contains properties and data about the build environment (i.e. not the project).
  • don't mix dependencies of different projects. It seems a very bad idea (it means that if you uddate a widely used dependency (like hibernate for instance) for one particular customer: it will be updated for all your projects. And so you will have to re-validate all your projects against the new version of hibernate)

And just a little question, what difference do you make between versioning your settings.xml and versioning your parent pom ?

Upvotes: 2

Related Questions