From b7a6a72bf7873a829f6e7a9978a3d9ae972ecf0d Mon Sep 17 00:00:00 2001 From: DidierLoiseau Date: Sun, 6 Oct 2024 23:57:19 +0200 Subject: [PATCH] [MNG-8295] Dependency Manager Transitivity (now default) handles dependency management inconsistently Actually use TransitiveDependencyManager when maven.resolver.dependencyManagerTransitivity=true --- .../internal/impl/resolver/MavenSessionBuilderSupplier.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/MavenSessionBuilderSupplier.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/MavenSessionBuilderSupplier.java index 8b79d2bbae37..cadf317de921 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/MavenSessionBuilderSupplier.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/MavenSessionBuilderSupplier.java @@ -43,6 +43,7 @@ import org.eclipse.aether.resolution.ArtifactDescriptorPolicy; import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry; import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; +import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager; import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; @@ -84,7 +85,10 @@ protected DependencyManager getDependencyManager() { } public DependencyManager getDependencyManager(boolean transitive) { - return new ClassicDependencyManager(transitive, getScopeManager()); + if (transitive) { + return new TransitiveDependencyManager(getScopeManager()); + } + return new ClassicDependencyManager(getScopeManager()); } protected DependencySelector getDependencySelector() {