mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-28 17:15:55 +00:00
This commit is contained in:
@@ -339,7 +339,7 @@ public class DaemonConnector {
|
||||
final Path mvndHome = parameters.mvndHome();
|
||||
final Path workingDir = parameters.userDir();
|
||||
String command = "";
|
||||
try (DirectoryStream<Path> jarPaths = Files.newDirectoryStream(mvndHome.resolve("mvn/lib/ext"))) {
|
||||
try (DirectoryStream<Path> jarPaths = Files.newDirectoryStream(mvndHome.resolve("lib"))) {
|
||||
List<String> args = new ArrayList<>();
|
||||
// executable
|
||||
final String java = Os.current().isUnixLike() ? "bin/java" : "bin\\java.exe";
|
||||
@@ -358,10 +358,10 @@ public class DaemonConnector {
|
||||
}
|
||||
}
|
||||
if (mvndCommonPath == null) {
|
||||
throw new IllegalStateException("Could not find mvnd-common jar in mvn/lib/ext/");
|
||||
throw new IllegalStateException("Could not find mvnd-common jar in lib/");
|
||||
}
|
||||
if (mvndAgentPath == null) {
|
||||
throw new IllegalStateException("Could not find mvnd-agent jar in mvn/lib/ext/");
|
||||
throw new IllegalStateException("Could not find mvnd-agent jar in lib/");
|
||||
}
|
||||
args.add("-classpath");
|
||||
args.add(mvndCommonPath + File.pathSeparator + mvndAgentPath);
|
||||
@@ -419,8 +419,8 @@ public class DaemonConnector {
|
||||
}
|
||||
|
||||
Environment.MVND_HOME.addSystemProperty(args, mvndHome.toString());
|
||||
args.add("-Dmaven.home=" + mvndHome.resolve("mvn"));
|
||||
args.add("-Dmaven.conf=" + mvndHome.resolve("mvn/conf"));
|
||||
args.add("-Dmaven.home=" + mvndHome);
|
||||
args.add("-Dmaven.conf=" + mvndHome.resolve("conf"));
|
||||
|
||||
Environment.MVND_JAVA_HOME.addSystemProperty(
|
||||
args, parameters.javaHome().toString());
|
||||
|
@@ -120,10 +120,10 @@ public class DaemonParameters {
|
||||
private String mvndHomeFromExecutable() {
|
||||
Optional<String> cmd = ProcessHandle.current().info().command();
|
||||
if (Environment.isNative() && cmd.isPresent()) {
|
||||
final Path mvndH = Paths.get(cmd.get()).getParent().getParent();
|
||||
final Path mvndH = Paths.get(cmd.get()).getParent();
|
||||
if (mvndH != null) {
|
||||
final Path mvndDaemonLib = mvndH.resolve("mvn/lib/ext/mvnd-daemon-"
|
||||
+ BuildProperties.getInstance().getVersion() + ".jar");
|
||||
final Path mvndDaemonLib = mvndH.resolve(
|
||||
"lib/mvnd-daemon-" + BuildProperties.getInstance().getVersion() + ".jar");
|
||||
if (Files.exists(mvndDaemonLib)) {
|
||||
return mvndH.toString();
|
||||
}
|
||||
@@ -238,7 +238,8 @@ public class DaemonParameters {
|
||||
|
||||
public Path logbackConfigurationPath() {
|
||||
return property(Environment.MVND_LOGBACK)
|
||||
.orDefault(() -> mvndHome().resolve("conf/logback.xml").toString())
|
||||
.orDefault(() ->
|
||||
mvndHome().resolve("conf/logging/logback-mvnd.xml").toString())
|
||||
.orFail()
|
||||
.asPath();
|
||||
}
|
||||
|
Reference in New Issue
Block a user