Skip to content

Commit

Permalink
Adopt to latest mvn master changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Nov 22, 2024
1 parent 09649c1 commit 70c6be1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions daemon/src/main/java/org/apache/maven/cli/DaemonMavenInvoker.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.maven.cling.invoker.mvn.resident.ResidentMavenContext;
import org.apache.maven.cling.invoker.mvn.resident.ResidentMavenInvoker;
import org.apache.maven.cling.utils.CLIReportingUtils;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.jline.MessageUtils;
import org.apache.maven.logging.BuildEventListener;
import org.apache.maven.logging.LoggingOutputStream;
Expand All @@ -43,7 +44,7 @@ public DaemonMavenInvoker(ProtoLookup protoLookup) {
}

@Override
protected Terminal createTerminal(ResidentMavenContext context) {
protected void createTerminal(ResidentMavenContext context) {
MessageUtils.systemInstall(
builder -> {
builder.streams(
Expand All @@ -56,7 +57,12 @@ protected Terminal createTerminal(ResidentMavenContext context) {
}
},
terminal -> doConfigureWithTerminal(context, terminal));
return MessageUtils.getTerminal();
context.terminal = MessageUtils.getTerminal();
context.closeables.add(MessageUtils::systemUninstall);
MessageUtils.registerShutdownHook();
if (context.coloredOutput != null) {
MessageUtils.setColorEnabled(context.coloredOutput);
}
}

@Override
Expand Down Expand Up @@ -121,7 +127,7 @@ protected ContainerCapsuleFactory<ResidentMavenContext> createContainerCapsuleFa
}

@Override
protected int doExecute(ResidentMavenContext context) throws Exception {
protected int doExecute(ResidentMavenContext context, MavenExecutionRequest request) throws Exception {
context.logger.info(MessageUtils.builder()
.a("Processing build on daemon ")
.strong(Environment.MVND_ID.asString())
Expand All @@ -134,7 +140,7 @@ protected int doExecute(ResidentMavenContext context) throws Exception {
context.logger.info("rootDirectory: " + context.invokerRequest.rootDirectory());

try {
return super.doExecute(context);
return super.doExecute(context, request);
} finally {
LoggingOutputStream.forceFlush(System.out);
LoggingOutputStream.forceFlush(System.err);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<groovy.version>4.0.24</groovy.version>
<jansi.version>2.4.1</jansi.version>
<jline.version>3.27.1</jline.version>
<maven.version>4.0.0-beta-6-20241113.142745-2</maven.version>
<maven.version>4.0.0-beta-6-SNAPSHOT</maven.version>
<required-maven.version>3.9.9</required-maven.version>

<!-- Keep in sync with Maven -->
Expand Down

0 comments on commit 70c6be1

Please sign in to comment.