Make sure the maven.home and maven.conf properties are correctly set when the JVM is started, fixes #553

This commit is contained in:
Guillaume Nodet
2022-01-11 08:12:18 +01:00
committed by GitHub
parent 716fc1a9cc
commit 4c99b52e03
7 changed files with 131 additions and 12 deletions

View File

@@ -372,6 +372,9 @@ public class DaemonConnector {
}
Environment.MVND_HOME.addCommandLineOption(args, mvndHome.toString());
args.add("-Dmaven.home=" + mvndHome.resolve("mvn"));
args.add("-Dmaven.conf=" + mvndHome.resolve("mvn/conf"));
Environment.MVND_JAVA_HOME.addCommandLineOption(args, parameters.javaHome().toString());
Environment.LOGBACK_CONFIGURATION_FILE
.addCommandLineOption(args, parameters.logbackConfigurationPath().toString());

View File

@@ -112,6 +112,8 @@ public class DefaultClient implements Client {
System.setProperty(Environment.MVND_NO_BUFERING.getProperty(), Boolean.toString(true));
}
System.setProperty(Environment.MVND_HOME.getProperty(), parameters.mvndHome().toString());
int exitCode = 0;
boolean noBuffering = batchMode || parameters.noBuffering();
try (TerminalOutput output = new TerminalOutput(noBuffering, parameters.rollingWindowSize(), logFile)) {