This is an automated email from the ASF dual-hosted git repository. cstamas pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
The following commit(s) were added to refs/heads/master by this push: new 7820fcc2 Port mvnsh changes (#1228) 7820fcc2 is described below commit 7820fcc20ccab1da4413e63a193c271c8612e802 Author: Tamas Cservenak <ta...@cservenak.net> AuthorDate: Tue Dec 17 13:54:57 2024 +0100 Port mvnsh changes (#1228) Basically get rid of ResidentContext, is gone. Also, port some other minor mvn RC-3 changes as well. --- .../java/org/apache/maven/cli/DaemonMavenInvoker.java | 16 ++++++++-------- .../apache/maven/cli/DaemonMessageBuilderFactory.java | 2 +- .../maven/cli/DaemonPlexusContainerCapsuleFactory.java | 6 +++--- pom.xml | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenInvoker.java b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenInvoker.java index 6dfdb568..417433da 100644 --- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenInvoker.java +++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenInvoker.java @@ -27,7 +27,7 @@ import org.apache.maven.api.cli.InvokerRequest; import org.apache.maven.api.cli.Options; import org.apache.maven.cling.invoker.ContainerCapsuleFactory; import org.apache.maven.cling.invoker.ProtoLookup; -import org.apache.maven.cling.invoker.mvn.resident.ResidentMavenContext; +import org.apache.maven.cling.invoker.mvn.MavenContext; import org.apache.maven.cling.invoker.mvn.resident.ResidentMavenInvoker; import org.apache.maven.cling.utils.CLIReportingUtils; import org.apache.maven.execution.MavenExecutionRequest; @@ -44,7 +44,7 @@ public class DaemonMavenInvoker extends ResidentMavenInvoker { } @Override - protected void createTerminal(ResidentMavenContext context) { + protected void createTerminal(MavenContext context) { MessageUtils.systemInstall( builder -> { builder.streams( @@ -66,7 +66,7 @@ public class DaemonMavenInvoker extends ResidentMavenInvoker { } @Override - protected void doConfigureWithTerminal(ResidentMavenContext context, Terminal terminal) { + protected void doConfigureWithTerminal(MavenContext context, Terminal terminal) { super.doConfigureWithTerminal(context, terminal); Optional<Boolean> rawStreams = context.invokerRequest.options().rawStreams(); if (rawStreams.orElse(false)) { @@ -86,12 +86,12 @@ public class DaemonMavenInvoker extends ResidentMavenInvoker { } @Override - protected org.apache.maven.logging.BuildEventListener doDetermineBuildEventListener(ResidentMavenContext context) { + protected org.apache.maven.logging.BuildEventListener doDetermineBuildEventListener(MavenContext context) { return context.invokerRequest.lookup().lookup(BuildEventListener.class); } @Override - protected void helpOrVersionAndMayExit(ResidentMavenContext context) throws Exception { + protected void helpOrVersionAndMayExit(MavenContext context) throws Exception { InvokerRequest invokerRequest = context.invokerRequest; BuildEventListener buildEventListener = context.invokerRequest.parserRequest().lookup().lookup(BuildEventListener.class); @@ -110,7 +110,7 @@ public class DaemonMavenInvoker extends ResidentMavenInvoker { } @Override - protected void preCommands(ResidentMavenContext context) throws Exception { + protected void preCommands(MavenContext context) throws Exception { Options mavenOptions = context.invokerRequest.options(); if (mavenOptions.verbose().orElse(false) || mavenOptions.showVersion().orElse(false)) { context.invokerRequest @@ -122,12 +122,12 @@ public class DaemonMavenInvoker extends ResidentMavenInvoker { } @Override - protected ContainerCapsuleFactory<ResidentMavenContext> createContainerCapsuleFactory() { + protected ContainerCapsuleFactory<MavenContext> createContainerCapsuleFactory() { return new DaemonPlexusContainerCapsuleFactory(); } @Override - protected int doExecute(ResidentMavenContext context, MavenExecutionRequest request) throws Exception { + protected int doExecute(MavenContext context, MavenExecutionRequest request) throws Exception { context.logger.info(MessageUtils.builder() .a("Processing build on daemon ") .strong(Environment.MVND_ID.asString()) diff --git a/daemon/src/main/java/org/apache/maven/cli/DaemonMessageBuilderFactory.java b/daemon/src/main/java/org/apache/maven/cli/DaemonMessageBuilderFactory.java index ebadddd5..cc154ecc 100644 --- a/daemon/src/main/java/org/apache/maven/cli/DaemonMessageBuilderFactory.java +++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMessageBuilderFactory.java @@ -18,12 +18,12 @@ */ package org.apache.maven.cli; -import javax.annotation.Priority; import javax.inject.Named; import javax.inject.Singleton; import org.apache.maven.api.annotations.Experimental; import org.apache.maven.jline.JLineMessageBuilderFactory; +import org.eclipse.sisu.Priority; import org.mvndaemon.mvnd.common.Environment; @Named diff --git a/daemon/src/main/java/org/apache/maven/cli/DaemonPlexusContainerCapsuleFactory.java b/daemon/src/main/java/org/apache/maven/cli/DaemonPlexusContainerCapsuleFactory.java index 6bbb6136..2509c231 100644 --- a/daemon/src/main/java/org/apache/maven/cli/DaemonPlexusContainerCapsuleFactory.java +++ b/daemon/src/main/java/org/apache/maven/cli/DaemonPlexusContainerCapsuleFactory.java @@ -26,11 +26,11 @@ import java.util.Set; import java.util.stream.Stream; import org.apache.maven.cling.invoker.PlexusContainerCapsuleFactory; -import org.apache.maven.cling.invoker.mvn.resident.ResidentMavenContext; +import org.apache.maven.cling.invoker.mvn.MavenContext; import org.apache.maven.extension.internal.CoreExtensionEntry; import org.mvndaemon.mvnd.common.Environment; -public class DaemonPlexusContainerCapsuleFactory extends PlexusContainerCapsuleFactory<ResidentMavenContext> { +public class DaemonPlexusContainerCapsuleFactory extends PlexusContainerCapsuleFactory<MavenContext> { @Override protected Set<String> collectExportedArtifacts( @@ -50,7 +50,7 @@ public class DaemonPlexusContainerCapsuleFactory extends PlexusContainerCapsuleF } @Override - protected List<Path> parseExtClasspath(ResidentMavenContext context) throws Exception { + protected List<Path> parseExtClasspath(MavenContext context) throws Exception { return Stream.of(Environment.MVND_EXT_CLASSPATH.asString().split(",")) .filter(s -> s != null && !s.isEmpty()) .map(Paths::get) diff --git a/pom.xml b/pom.xml index 367ad485..5441dd16 100644 --- a/pom.xml +++ b/pom.xml @@ -83,11 +83,11 @@ <groovy.version>4.0.24</groovy.version> <jansi.version>2.4.1</jansi.version> <jline.version>3.28.0</jline.version> - <maven.version>4.0.0-rc-1</maven.version> + <maven.version>4.0.0-rc-3-SNAPSHOT</maven.version> <required-maven.version>3.9.9</required-maven.version> <!-- Keep in sync with Maven --> - <maven.resolver.version>2.0.4</maven.resolver.version> + <maven.resolver.version>2.0.5</maven.resolver.version> <slf4j.version>2.0.16</slf4j.version> <sisu.version>0.9.0.M3</sisu.version> <maven.plugin-tools.version>3.15.1</maven.plugin-tools.version>