diff --git a/.mvn/maven.config b/.mvn/maven.config deleted file mode 100644 index e69de29b..00000000 diff --git a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCling.java b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCling.java index 26125366..90c3ae2d 100644 --- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCling.java +++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCling.java @@ -48,10 +48,13 @@ public class DaemonMavenCling implements DaemonCli { public DaemonMavenCling() { this.parser = new DaemonMavenParser(); - this.invoker = new DaemonMavenInvoker(ProtoLookup.builder() - .addMapping( - ClassWorld.class, ((ClassRealm) Thread.currentThread().getContextClassLoader()).getWorld()) - .build()); + this.invoker = new DaemonMavenInvoker( + ProtoLookup.builder() + .addMapping( + ClassWorld.class, + ((ClassRealm) Thread.currentThread().getContextClassLoader()).getWorld()) + .build(), + null); } @Override 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 86055bfc..d1170977 100644 --- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenInvoker.java +++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenInvoker.java @@ -20,11 +20,13 @@ package org.apache.maven.cli; import java.io.OutputStream; import java.io.PrintStream; +import java.util.function.Consumer; +import org.apache.maven.api.annotations.Nullable; import org.apache.maven.api.cli.InvokerException; 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.LookupContext; import org.apache.maven.cling.invoker.ProtoLookup; import org.apache.maven.cling.invoker.mvn.MavenContext; import org.apache.maven.cling.invoker.mvn.resident.ResidentMavenInvoker; @@ -37,8 +39,8 @@ import org.jline.terminal.TerminalBuilder; import org.mvndaemon.mvnd.common.Environment; public class DaemonMavenInvoker extends ResidentMavenInvoker { - public DaemonMavenInvoker(ProtoLookup protoLookup) { - super(protoLookup); + public DaemonMavenInvoker(ProtoLookup protoLookup, @Nullable Consumer contextConsumer) { + super(protoLookup, contextConsumer); } @Override @@ -81,12 +83,12 @@ public class DaemonMavenInvoker extends ResidentMavenInvoker { InvokerRequest invokerRequest = context.invokerRequest; BuildEventListener buildEventListener = context.invokerRequest.parserRequest().lookup().lookup(BuildEventListener.class); - if (invokerRequest.options().help().isPresent()) { - context.invokerRequest.options().displayHelp(invokerRequest.parserRequest(), buildEventListener::log); + if (context.options().help().isPresent()) { + context.options().displayHelp(invokerRequest.parserRequest(), buildEventListener::log); throw new InvokerException.ExitException(0); } - if (invokerRequest.options().showVersionAndExit().isPresent()) { - if (invokerRequest.options().quiet().orElse(false)) { + if (context.options().showVersionAndExit().isPresent()) { + if (context.options().quiet().orElse(false)) { buildEventListener.log(CLIReportingUtils.showVersionMinimal()); } else { buildEventListener.log(CLIReportingUtils.showVersion()); @@ -97,8 +99,8 @@ public class DaemonMavenInvoker extends ResidentMavenInvoker { @Override protected void preCommands(MavenContext context) throws Exception { - Options mavenOptions = context.invokerRequest.options(); - if (mavenOptions.verbose().orElse(false) || mavenOptions.showVersion().orElse(false)) { + if (context.options().verbose().orElse(false) + || context.options().showVersion().orElse(false)) { context.invokerRequest .parserRequest() .lookup() diff --git a/pom.xml b/pom.xml index 7291339b..9bd7f87d 100644 --- a/pom.xml +++ b/pom.xml @@ -83,16 +83,16 @@ 4.0.27 2.4.1 3.30.4 - 4.0.0-rc-3 - 3.9.9 + 4.0.0-rc-4 + 3.9.10 2.0.10 - 2.0.16 + 2.0.17 0.9.0.M4 3.15.1 4.0.2 - 4.0.4 + 4.1.0 2.0.1 2.1.0 @@ -109,6 +109,9 @@ 1.1.0 1.21.3 1.4.21 + + + 5.13.1