[ https://issues.apache.org/jira/browse/MRESOLVER-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17824060#comment-17824060 ]
Tamas Cservenak edited comment on MRESOLVER-503 at 3/6/24 3:35 PM: ------------------------------------------------------------------- When I "lock down" the json-smart version in msal4j (locally edited POM in local repo) this happens, as expected: {noformat} [cstamas@angeleyes MRESOLVER-503]$ jbang mima@maveniverse -s settings.xml MIMA (Runtime 'standalone-static' version 2.4.8) ==== Maven version 3.9.6 Managed true Basedir /home/cstamas/tmp/MRESOLVER-503 Offline false MAVEN_HOME /home/cstamas/.sdkman/candidates/maven/current settings.xml /home/cstamas/.sdkman/candidates/maven/current/conf/settings.xml toolchains.xml /home/cstamas/.sdkman/candidates/maven/current/conf/toolchains.xml USER_HOME /home/cstamas/.m2 settings.xml settings.xml settings-security.xml /home/cstamas/.m2/settings-security.xml local repository /home/cstamas/tmp/MRESOLVER-503/local PROFILES Active [oss-development] Inactive [] REMOTE REPOSITORIES central (https://repo.maven.apache.org/maven2/, default, releases) redhat (https://maven.repository.redhat.com/ga/, default, releases)prompt> graph com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 Error org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies for com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 () at org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate.collectDependencies (DependencyCollectorDelegate.java:263) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:87) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:306) at eu.maveniverse.maven.mima.cli.Graph.doCall (Graph.java:92) at eu.maveniverse.maven.mima.cli.ResolverCommandSupport.call (ResolverCommandSupport.java:81) at eu.maveniverse.maven.mima.cli.ResolverCommandSupport.call (ResolverCommandSupport.java:21) at picocli.CommandLine.executeUserObject (CommandLine.java:2041) at picocli.CommandLine.access$1500 (CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent (CommandLine.java:2461) at picocli.CommandLine$RunLast.handle (CommandLine.java:2453) at picocli.CommandLine$RunLast.handle (CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute (CommandLine.java:2273) at picocli.CommandLine$RunLast.execute (CommandLine.java:2417) at picocli.CommandLine.execute (CommandLine.java:2170) at picocli.shell.jline3.PicocliCommands.invoke (PicocliCommands.java:287) at org.jline.console.impl.SystemRegistryImpl.execute (SystemRegistryImpl.java:1238) at org.jline.console.impl.SystemRegistryImpl.execute (SystemRegistryImpl.java:1283) at eu.maveniverse.maven.mima.cli.Repl.call (Repl.java:75) at eu.maveniverse.maven.mima.cli.Main.call (Main.java:40) at eu.maveniverse.maven.mima.cli.Main.call (Main.java:9) at picocli.CommandLine.executeUserObject (CommandLine.java:2041) at picocli.CommandLine.access$1500 (CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent (CommandLine.java:2461) at picocli.CommandLine$RunLast.handle (CommandLine.java:2453) at picocli.CommandLine$RunLast.handle (CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute (CommandLine.java:2273) at picocli.CommandLine$RunLast.execute (CommandLine.java:2417) at picocli.CommandLine.execute (CommandLine.java:2170) at eu.maveniverse.maven.mima.cli.Main.main (Main.java:46) Caused by: org.eclipse.aether.collection.UnsolvableVersionConflictException: Could not resolve version conflict among [com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 -> com.nimbusds:oauth2-oidc-sdk:jar:9.35 -> net.minidev:json-smart:jar:[1.3.3,2.4.8], com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 -> net.minidev:json-smart:jar:[2.4.8.redhat-00001,2.4.8.redhat-00001]] at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.newFailure (NearestVersionSelector.java:129) at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.backtrack (NearestVersionSelector.java:100) at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.selectVersion (NearestVersionSelector.java:80) at org.eclipse.aether.util.graph.transformer.ConflictResolver.transformGraph (ConflictResolver.java:217) at org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer.transformGraph (ChainedDependencyGraphTransformer.java:71) at org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate.collectDependencies (DependencyCollectorDelegate.java:246) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:87) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:306) at eu.maveniverse.maven.mima.cli.Graph.doCall (Graph.java:92) at eu.maveniverse.maven.mima.cli.ResolverCommandSupport.call (ResolverCommandSupport.java:81) at eu.maveniverse.maven.mima.cli.ResolverCommandSupport.call (ResolverCommandSupport.java:21) at picocli.CommandLine.executeUserObject (CommandLine.java:2041) at picocli.CommandLine.access$1500 (CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent (CommandLine.java:2461) at picocli.CommandLine$RunLast.handle (CommandLine.java:2453) at picocli.CommandLine$RunLast.handle (CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute (CommandLine.java:2273) at picocli.CommandLine$RunLast.execute (CommandLine.java:2417) at picocli.CommandLine.execute (CommandLine.java:2170) at picocli.shell.jline3.PicocliCommands.invoke (PicocliCommands.java:287) at org.jline.console.impl.SystemRegistryImpl.execute (SystemRegistryImpl.java:1238) at org.jline.console.impl.SystemRegistryImpl.execute (SystemRegistryImpl.java:1283) at eu.maveniverse.maven.mima.cli.Repl.call (Repl.java:75) at eu.maveniverse.maven.mima.cli.Main.call (Main.java:40) at eu.maveniverse.maven.mima.cli.Main.call (Main.java:9) at picocli.CommandLine.executeUserObject (CommandLine.java:2041) at picocli.CommandLine.access$1500 (CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent (CommandLine.java:2461) at picocli.CommandLine$RunLast.handle (CommandLine.java:2453) at picocli.CommandLine$RunLast.handle (CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute (CommandLine.java:2273) at picocli.CommandLine$RunLast.execute (CommandLine.java:2417) at picocli.CommandLine.execute (CommandLine.java:2170) at eu.maveniverse.maven.mima.cli.Main.main (Main.java:46) prompt> {noformat} was (Author: cstamas): When I "lock down" the json-smart version in msal4j (locally edited POM in local repo) this happens, as expected: {noformat} [cstamas@angeleyes MRESOLVER-503]$ jbang mima@maveniverse -s settings.xml MIMA (Runtime 'standalone-static' version 2.4.8) ==== Maven version 3.9.6 Managed true Basedir /home/cstamas/tmp/MRESOLVER-503 Offline false MAVEN_HOME /home/cstamas/.sdkman/candidates/maven/current settings.xml /home/cstamas/.sdkman/candidates/maven/current/conf/settings.xml toolchains.xml /home/cstamas/.sdkman/candidates/maven/current/conf/toolchains.xml USER_HOME /home/cstamas/.m2 settings.xml settings.xml settings-security.xml /home/cstamas/.m2/settings-security.xml local repository /home/cstamas/tmp/MRESOLVER-503/local PROFILES Active [oss-development] Inactive [] REMOTE REPOSITORIES central (https://repo.maven.apache.org/maven2/, default, releases) redhat (https://maven.repository.redhat.com/ga/, default, releases)prompt> graph com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 Error org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies for com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 () at org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate.collectDependencies (DependencyCollectorDelegate.java:263) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:87) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:306) at eu.maveniverse.maven.mima.cli.Graph.doCall (Graph.java:92) at eu.maveniverse.maven.mima.cli.ResolverCommandSupport.call (ResolverCommandSupport.java:81) at eu.maveniverse.maven.mima.cli.ResolverCommandSupport.call (ResolverCommandSupport.java:21) at picocli.CommandLine.executeUserObject (CommandLine.java:2041) at picocli.CommandLine.access$1500 (CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent (CommandLine.java:2461) at picocli.CommandLine$RunLast.handle (CommandLine.java:2453) at picocli.CommandLine$RunLast.handle (CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute (CommandLine.java:2273) at picocli.CommandLine$RunLast.execute (CommandLine.java:2417) at picocli.CommandLine.execute (CommandLine.java:2170) at picocli.shell.jline3.PicocliCommands.invoke (PicocliCommands.java:287) at org.jline.console.impl.SystemRegistryImpl.execute (SystemRegistryImpl.java:1238) at org.jline.console.impl.SystemRegistryImpl.execute (SystemRegistryImpl.java:1283) at eu.maveniverse.maven.mima.cli.Repl.call (Repl.java:75) at eu.maveniverse.maven.mima.cli.Main.call (Main.java:40) at eu.maveniverse.maven.mima.cli.Main.call (Main.java:9) at picocli.CommandLine.executeUserObject (CommandLine.java:2041) at picocli.CommandLine.access$1500 (CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent (CommandLine.java:2461) at picocli.CommandLine$RunLast.handle (CommandLine.java:2453) at picocli.CommandLine$RunLast.handle (CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute (CommandLine.java:2273) at picocli.CommandLine$RunLast.execute (CommandLine.java:2417) at picocli.CommandLine.execute (CommandLine.java:2170) at eu.maveniverse.maven.mima.cli.Main.main (Main.java:46) Caused by: org.eclipse.aether.collection.UnsolvableVersionConflictException: Could not resolve version conflict among [com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 -> com.nimbusds:oauth2-oidc-sdk:jar:9.35 -> net.minidev:json-smart:jar:[1.3.3,2.4.8], com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 -> net.minidev:json-smart:jar:[2.4.8.redhat-00001,2.4.8.redhat-00001]] at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.newFailure (NearestVersionSelector.java:129) at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.backtrack (NearestVersionSelector.java:100) at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.selectVersion (NearestVersionSelector.java:80) at org.eclipse.aether.util.graph.transformer.ConflictResolver.transformGraph (ConflictResolver.java:217) at org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer.transformGraph (ChainedDependencyGraphTransformer.java:71) at org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate.collectDependencies (DependencyCollectorDelegate.java:246) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:87) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:306) at eu.maveniverse.maven.mima.cli.Graph.doCall (Graph.java:92) at eu.maveniverse.maven.mima.cli.ResolverCommandSupport.call (ResolverCommandSupport.java:81) at eu.maveniverse.maven.mima.cli.ResolverCommandSupport.call (ResolverCommandSupport.java:21) at picocli.CommandLine.executeUserObject (CommandLine.java:2041) at picocli.CommandLine.access$1500 (CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent (CommandLine.java:2461) at picocli.CommandLine$RunLast.handle (CommandLine.java:2453) at picocli.CommandLine$RunLast.handle (CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute (CommandLine.java:2273) at picocli.CommandLine$RunLast.execute (CommandLine.java:2417) at picocli.CommandLine.execute (CommandLine.java:2170) at picocli.shell.jline3.PicocliCommands.invoke (PicocliCommands.java:287) at org.jline.console.impl.SystemRegistryImpl.execute (SystemRegistryImpl.java:1238) at org.jline.console.impl.SystemRegistryImpl.execute (SystemRegistryImpl.java:1283) at eu.maveniverse.maven.mima.cli.Repl.call (Repl.java:75) at eu.maveniverse.maven.mima.cli.Main.call (Main.java:40) at eu.maveniverse.maven.mima.cli.Main.call (Main.java:9) at picocli.CommandLine.executeUserObject (CommandLine.java:2041) at picocli.CommandLine.access$1500 (CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent (CommandLine.java:2461) at picocli.CommandLine$RunLast.handle (CommandLine.java:2453) at picocli.CommandLine$RunLast.handle (CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute (CommandLine.java:2273) at picocli.CommandLine$RunLast.execute (CommandLine.java:2417) at picocli.CommandLine.execute (CommandLine.java:2170) at eu.maveniverse.maven.mima.cli.Main.main (Main.java:46) prompt> {noformat} > Differences between results of dependency:tree and direct resolver API calls > ---------------------------------------------------------------------------- > > Key: MRESOLVER-503 > URL: https://issues.apache.org/jira/browse/MRESOLVER-503 > Project: Maven Resolver > Issue Type: Bug > Components: Resolver > Reporter: Alexey Loubyansky > Priority: Major > > I noticed a difference in dependency trees produced by dependency:tree and > what seems to be an equivalent invocation of the resolver using its API. > It can be reproduced by applying the following change to the maven-resolver > demo class > [https://github.com/apache/maven-resolver/compare/master...aloubyansky:maven-resolver:dep-tree-diff?expand=1] > Running that results in > {code:java} > com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 > +- com.nimbusds:oauth2-oidc-sdk:jar:9.35 [compile] > | +- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1 [compile] > | +- com.nimbusds:content-type:jar:2.2 [compile] > | +- net.minidev:json-smart:jar:2.4.8 [compile] > | +- com.nimbusds:lang-tag:jar:1.6 [compile] > | \- com.nimbusds:nimbus-jose-jwt:jar:9.22 [compile] > +- org.slf4j:slf4j-api:jar:1.7.36.redhat-00002 [compile] > \- com.fasterxml.jackson.core:jackson-databind:jar:2.13.2.1 [compile] {code} > Notice the position of json-smart in the tree - it's a dependency of > oauth2-oidc-sdk in this case. > Now > {code:java} > cd ~/.m2/repository/com/microsoft/azure/msal4j/1.13.1.redhat-00001{code} > {code:java} > mvn dependency:tree -f msal4j-1.13.1.redhat-00001.pom -Dscope=compile > {code} > The output is > {code:java} > [INFO] com.microsoft.azure:msal4j:jar:1.13.1.redhat-00001 > [INFO] +- com.nimbusds:oauth2-oidc-sdk:jar:9.35:compile > [INFO] | +- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile > [INFO] | +- com.nimbusds:content-type:jar:2.2:compile > [INFO] | +- com.nimbusds:lang-tag:jar:1.6:compile > [INFO] | \- com.nimbusds:nimbus-jose-jwt:jar:9.22:compile > [INFO] +- net.minidev:json-smart:jar:2.4.8:compile > [INFO] | \- net.minidev:accessors-smart:jar:2.4.8:compile > [INFO] | \- org.ow2.asm:asm:jar:9.1:compile > [INFO] +- org.slf4j:slf4j-api:jar:1.7.36.redhat-00002:compile > [INFO] +- org.projectlombok:lombok:jar:1.18.6:provided > [INFO] \- com.fasterxml.jackson.core:jackson-databind:jar:2.13.2.1:compile > [INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2:compile > [INFO] \- com.fasterxml.jackson.core:jackson-core:jar:2.13.2:compile {code} > In this case json-smart is shown as a direct dependency of msal4j, which it > is in its POM. > Following the preference of the nearest to the root, dependency:tree seems to > be correct, isn't it? > In any case, I'd expect the same result (for compile scope) dependencies out > of of both approaches. Thanks. -- This message was sent by Atlassian Jira (v8.20.10#820010)