From c4ccba7bf93e45850c2a6897d751a27ff3ef50d2 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 11 Jan 2024 13:16:51 +0100 Subject: [PATCH] [MNG-7994] Update to Resolver 2.0.0-alpha-6 (#1373) Update to alpha-6. Also, move off from deprecated default ctor of def repo session in tests. --- https://issues.apache.org/jira/browse/MNG-7994 --- .../src/main/java/org/apache/maven/RepositoryUtils.java | 2 +- .../maven/lifecycle/internal/LifecycleModuleBuilderTest.java | 5 ++++- .../plugin/PluginParameterExpressionEvaluatorV4Test.java | 3 ++- .../maven/cli/transfer/ConsoleMavenTransferListenerTest.java | 2 +- .../repository/internal/MavenRepositorySystemUtils.java | 2 +- pom.xml | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java index 0a514a3d82..c0e5fd9591 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -369,7 +369,7 @@ public class RepositoryUtils { } newSession = new DefaultRepositorySystemSession(session); } else { - newSession = new DefaultRepositorySystemSession(); + newSession = new DefaultRepositorySystemSession(h -> false); // no close handle used } final LocalRepositoryManager llrm = diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java index 8d018ac61b..3852f3e980 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilderTest.java @@ -65,7 +65,10 @@ class LifecycleModuleBuilderTest { mavenExecutionRequest.setExecutionListener(new AbstractExecutionListener()); mavenExecutionRequest.setGoals(Arrays.asList("clean")); final MavenSession session = new MavenSession( - null, new DefaultRepositorySystemSession(), mavenExecutionRequest, defaultMavenExecutionResult); + null, + new DefaultRepositorySystemSession(h -> false), + mavenExecutionRequest, + defaultMavenExecutionResult); final ProjectDependencyGraphStub dependencyGraphStub = new ProjectDependencyGraphStub(); session.setProjectDependencyGraph(dependencyGraphStub); session.setProjects(dependencyGraphStub.getSortedProjects()); diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java index 7a83279f4f..f3af5c1b1a 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java @@ -312,7 +312,8 @@ public class PluginParameterExpressionEvaluatorV4Test extends AbstractCoreMavenC .setBaseDirectory(new File("")) .setLocalRepository(repo); - DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); + DefaultRepositorySystemSession repositorySession = + new DefaultRepositorySystemSession(h -> false); // no close handle repositorySession.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory() .newInstance(repositorySession, new LocalRepository(repo.getUrl()))); MavenSession session = diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListenerTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListenerTest.java index cc726cb71f..8d7584fdff 100644 --- a/maven-embedder/src/test/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListenerTest.java +++ b/maven-embedder/src/test/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListenerTest.java @@ -72,7 +72,7 @@ class ConsoleMavenTransferListenerTest { TransferResource resource = new TransferResource(null, null, "http://maven.org/test/test-resource", null, null); resource.setContentLength(size - 1); - DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); + DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(h -> false); // no close handle // warm up test(listener, session, resource, 0); diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index a8b5f08743..74da91fc9f 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -63,7 +63,7 @@ public final class MavenRepositorySystemUtils { */ @Deprecated public static DefaultRepositorySystemSession newSession() { - DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); + DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(h -> false); // no close handle DependencyTraverser depTraverser = new FatArtifactTraverser(); session.setDependencyTraverser(depTraverser); diff --git a/pom.xml b/pom.xml index a5ff100a10..14c7bbc78f 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ under the License. 1.26 1.0.0 4.0.1 - 2.0.0-alpha-5 + 2.0.0-alpha-6 2.0 0.9.0.M2 2.0.11