you can do it with exclusions

depMgt will not help cause as soon as you get the feature you will get
conflicts between libs etc, so same than bom, it only works when 100%
orthogonal which is not your example for sure (commons is everywhere and
version is important, latest doesn't always work sadly), replacement
enables that more smoothly but still, a one time update of the pom IMHO

Romain Manni-Bucau
@rmannibucau <https://x.com/rmannibucau> | .NET Blog
<https://dotnetbirdie.github.io/> | Blog <https://rmannibucau.github.io/> | Old
Blog <http://rmannibucau.wordpress.com> | Github
<https://github.com/rmannibucau> | LinkedIn
<https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/en-us/product/java-ee-8-high-performance-9781788473064>
Javaccino founder (Java/.NET service - contact via linkedin)


Le sam. 11 oct. 2025 à 21:42, Vladimir Sitnikov <[email protected]>
a écrit :

> >automagic to replace dependency A by
> >dependency B cause B is in a dependency management (your case since
> commons
> >compress are different dependencies)
>
> Romain,
>
> I do not think I am asking for automatic replacement of dependency A by B.
>
> In my case, commons-compress-core 2.0.0 depends via dependencyManagemnt on
> commons-compress 2.0.0 bom.
> I want Maven to bump commons-compress from 1.0.0 to 2.0.0 based on that
> dependencyManagement info.
> In other words, I would like Maven to select a highest version among the
> versions mentioned in
> <dependencies> and <dependencyManagement> blocks in my transitive
> dependency poms.
>
> Vladimir
>

Reply via email to