Howdy, yes, I had also to "tweak" the project: as can be seen, I added [INFO] ╰─org.example:commons-compress-core:jar:2.0.0 [compile] (origin: central) [INFO] ╰─org.example:commons-compress:jar:2.0.0 [compile] (origin: central)
(commons-compress-core:2.0.0 depends on commons-compress:2,0.0) The goal of this change was to introduce a conflict. Then, by "highest" I instructed Maven to resolve this conflict by going for "highest" (instead of classic) "nearest". So, key aspects: * these things may happen only in transitive hull (not and never in direct deps) * conflict should exist, that resolver tries to resolve This is what I said "like hamcrest": they also have hamcrest-core 3.x, which is an empty jar. Thanks T On Sun, Oct 12, 2025 at 10:42 AM Vladimir Sitnikov <[email protected]> wrote: > > >here as "loser": > > Tamás, I must be missing something, however, I don't think I get 2.0.0 in > the runtime. > Frankly, I wasn't able to get "conflicts with..." in my output. > Could you please clarify if you get 2.0.0 resolved in runtime somehow? > (e.g. try with the newer code that includes classes to print the versions) > > I've added classes to print the versions in runtime (see [1]), and I get > only 1.0.0 versions in runtime for Maven 4. > > I tried ./mvnw -V eu.maveniverse.maven.plugins:toolbox:tree verify > -Daether.conflictResolver.versionSelector.selectionStrategy=highest > -DverboseTree > > Apache Maven 4.0.0-SNAPSHOT (8134db6f3c18ab2c68764a5ae05c9e08846b9787) > [INFO] org.example:app:jar:1.0.0 (origin: central) > [INFO] ├─org.example:lib-uses-v1:jar:1.0.0 [compile] (origin: central) > [INFO] │ ╰─org.example:commons-compress:jar:1.0.0 [runtime] (origin: > central) > [INFO] ╰─org.example:lib-uses-v2:jar:2.0.0 [compile] (origin: central) > [INFO] ╰─org.example:commons-compress-tar:jar:2.0.0 [runtime] (origin: > central) > [INFO] ╰─org.example:commons-compress-core:jar:2.0.0 [runtime] (origin: > central) > > Note that Maven 4 uses only 1.0.0 versions in the runtime: > > [INFO] --- exec:3.5.1:java (default) @ app --- > [INFO] Loaded 50 auto-discovered prefixes for remote repository > ow2-snapshot > (prefixes-ow2-snapshot-40669f8efefaadb4c1705a2585cefc8851f735ac.txt) > [INFO] [stdout] lib-uses-v1: > [INFO] [stdout] CoreVersion = 1.0.0 > [INFO] [stdout] TarCompressor = 1.0.0 > [INFO] [stdout] XzCompressor = 1.0.0 > [INFO] [stdout] lib-uses-v2: > [INFO] [stdout] CoreVersion = 1.0.0 > [INFO] [stdout] TarCompressor = 1.0.0 > > [1] > https://github.com/vlsi/jarsplit/commit/5e3fa1ecd3f26a2116aa83a92e85b69560a597f6 > > Vladimir --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
