Hi In august 2021 we discussed it in "Request for Enhancement: Dependency Overrides" thread and it ended up speaking of a plugin since as soon as you add a dependency you are responsible to decide if you want to merge or not and therefore there must not be any automagic to replace dependency A by dependency B cause B is in a dependency management (your case since commons compress are different dependencies)
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 à 14:49, Tamás Cservenák <[email protected]> a écrit : > Howdy > > Did you check the gist i posted earlier? It already solves it (by tweaking > deps, and making compress-core depend on compress, similar pattern that > hamcrest did) > > T > > On Sat, Oct 11, 2025, 14:47 Vladimir Sitnikov <[email protected] > > > wrote: > > > Thanks Tamas, Piotr. > > > > I indeed oversimplified the example, so it resulted in an > > accidental "nearest wins" case. Can we put it aside for now? > > > > I've updated the example so the maven4 project depends on > > commons-compress:1.0.0 and commons-compress-tar:2.0.0 **indirectly**. > > In other words, the case is as Piotr suggests: the application uses two > > independent libraries which in turn depend on 1.0.0 and 2.0.0 versions of > > the commons-compress library. > > > > Tamas: "goal to solve" is to make Maven converge to 2.0.0. Does that > sound > > clear to you? > > > > See the updated example: [1] > > > > The outcome does not change though. Maven 4.0.0-rc-4 still ends up with > > both commons-compress:1.0.0 and commons-compress-core:2.0.0 > > on the same classpath. > > > > [1] > > > > > https://github.com/vlsi/jarsplit/blob/db6d1f264d2451442ec7275a013da068dbe81e93/lib-user-maven4/pom.xml > > > > Vladimir > > >
