diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java index 4c2fc4772..615b8f685 100644 --- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java +++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java @@ -345,8 +345,8 @@ private Process startDaemonProcess(String daemonId, ClientOutput output) { // classpath String mvndAgentPath = null; String plexusClassworldsPath = null; - try (DirectoryStream jarPaths = - Files.newDirectoryStream(mvndHome.resolve("lib").resolve("ext"))) { + try (DirectoryStream jarPaths = Files.newDirectoryStream( + mvndHome.resolve("mvn").resolve("lib").resolve("ext"))) { for (Path jar : jarPaths) { String s = jar.getFileName().toString(); if (s.endsWith(".jar")) { @@ -356,7 +356,8 @@ private Process startDaemonProcess(String daemonId, ClientOutput output) { } } } - try (DirectoryStream jarPaths = Files.newDirectoryStream(mvndHome.resolve("boot"))) { + try (DirectoryStream jarPaths = + Files.newDirectoryStream(mvndHome.resolve("mvn").resolve("boot"))) { for (Path jar : jarPaths) { String s = jar.getFileName().toString(); if (s.endsWith(".jar")) { @@ -367,7 +368,7 @@ private Process startDaemonProcess(String daemonId, ClientOutput output) { } } if (mvndAgentPath == null) { - throw new IllegalStateException("Could not find mvnd-agent jar in lib/ext/"); + throw new IllegalStateException("Could not find mvnd-agent jar in mvn/lib/ext/"); } if (plexusClassworldsPath == null) { throw new IllegalStateException("Could not find plexus-classworlds jar in boot/"); @@ -428,8 +429,8 @@ private Process startDaemonProcess(String daemonId, ClientOutput output) { } Environment.MVND_HOME.addSystemProperty(args, mvndHome.toString()); - args.add("-Dmaven.home=" + mvndHome); - args.add("-Dmaven.conf=" + mvndHome.resolve("conf")); + args.add("-Dmaven.home=" + mvndHome.resolve("mvn")); + args.add("-Dmaven.conf=" + mvndHome.resolve("mvn").resolve("conf")); args.add("-Dclassworlds.conf=" + mvndHome.resolve("bin").resolve("mvnd-server.conf")); Environment.MVND_JAVA_HOME.addSystemProperty( diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java index bd8061eac..c12fc40df 100644 --- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java +++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java @@ -124,8 +124,11 @@ private String mvndHomeFromExecutable() { if (mvndH != null) { Path mvndDaemon = Paths.get("mvnd-daemon-" + BuildProperties.getInstance().getVersion() + ".jar"); - if (Files.exists(mvndH.resolve("lib").resolve(mvndDaemon)) - || Files.exists(mvndH.resolve("lib").resolve("ext").resolve(mvndDaemon))) { + if (Files.exists(mvndH.resolve("mvn").resolve("lib").resolve(mvndDaemon)) + || Files.exists(mvndH.resolve("mvn") + .resolve("lib") + .resolve("ext") + .resolve(mvndDaemon))) { return mvndH.toString(); } } @@ -239,8 +242,9 @@ public Path multiModuleProjectDirectory(Path projectDir) { public Path logbackConfigurationPath() { return property(Environment.MVND_LOGBACK) - .orDefault(() -> - mvndHome().resolve("conf/logging/logback-mvnd.xml").toString()) + .orDefault(() -> mvndHome() + .resolve("mvn/conf/logging/logback-server.xml") + .toString()) .orFail() .asPath(); } diff --git a/dist-m39/src/main/provisio/maven-distro.xml b/dist-m39/src/main/provisio/maven-distro.xml index b08acbf1c..1dcb00f31 100644 --- a/dist-m39/src/main/provisio/maven-distro.xml +++ b/dist-m39/src/main/provisio/maven-distro.xml @@ -17,14 +17,14 @@ --> - + - + @@ -33,7 +33,7 @@ - + diff --git a/dist-m40/src/main/provisio/maven-distro.xml b/dist-m40/src/main/provisio/maven-distro.xml index 3a83d8bc0..3d92c9eb3 100644 --- a/dist-m40/src/main/provisio/maven-distro.xml +++ b/dist-m40/src/main/provisio/maven-distro.xml @@ -17,14 +17,14 @@ --> - + - + @@ -33,7 +33,7 @@ - + diff --git a/dist/src/main/distro/bin/mvnd.conf b/dist/src/main/distro/bin/mvnd-client.conf similarity index 94% rename from dist/src/main/distro/bin/mvnd.conf rename to dist/src/main/distro/bin/mvnd-client.conf index 3df58b2b9..03462d3d1 100644 --- a/dist/src/main/distro/bin/mvnd.conf +++ b/dist/src/main/distro/bin/mvnd-client.conf @@ -16,7 +16,7 @@ # under the License. main is org.mvndaemon.mvnd.client.DefaultClient from plexus.core -set maven.home default ${mvnd.home} +set maven.home default ${mvnd.home}/mvn set maven.conf default ${maven.home}/conf set logback.configurationFile default ${maven.conf}/logging/logback-client.xml diff --git a/dist/src/main/distro/bin/mvnd-server.conf b/dist/src/main/distro/bin/mvnd-server.conf index 45976afba..508eb143c 100644 --- a/dist/src/main/distro/bin/mvnd-server.conf +++ b/dist/src/main/distro/bin/mvnd-server.conf @@ -16,9 +16,12 @@ # under the License. main is org.mvndaemon.mvnd.daemon.Server from plexus.core -set maven.home default ${mvnd.home} +set maven.home default ${mvnd.home}/mvn set maven.conf default ${maven.home}/conf +set logback.configurationFile default ${maven.conf}/logging/logback-server.xml +set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml + [plexus.core] load ${maven.conf}/logging optionally ${maven.home}/lib/ext/*.jar diff --git a/dist/src/main/distro/bin/mvnd.cmd b/dist/src/main/distro/bin/mvnd.cmd index 50fbeea16..a2869b072 100644 --- a/dist/src/main/distro/bin/mvnd.cmd +++ b/dist/src/main/distro/bin/mvnd.cmd @@ -197,7 +197,7 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher %MAVEN_OPTS% ^ %MAVEN_DEBUG_OPTS% ^ -classpath %CLASSWORLDS_JAR% ^ - "-Dclassworlds.conf=%MVND_HOME%\bin\mvnd.conf" + "-Dclassworlds.conf=%MVND_HOME%\bin\mvnd-client.conf" ^ "-Dmvnd.home=%MVND_HOME%" ^ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS% diff --git a/dist/src/main/distro/bin/mvnd.sh b/dist/src/main/distro/bin/mvnd.sh index 72eafe544..c6cd90d84 100755 --- a/dist/src/main/distro/bin/mvnd.sh +++ b/dist/src/main/distro/bin/mvnd.sh @@ -219,7 +219,7 @@ exec "$JAVACMD" \ $MAVEN_OPTS \ $MAVEN_DEBUG_OPTS \ -classpath "${CLASSWORLDS_JAR}" \ - "-Dclassworlds.conf=${MVND_HOME}/bin/mvnd.conf" \ + "-Dclassworlds.conf=${MVND_HOME}/bin/mvnd-client.conf" \ "-Dmvnd.home=${MVND_HOME}" \ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${CLASSWORLDS_LAUNCHER} "$@" diff --git a/dist/src/main/distro/bin/mvn b/dist/src/main/distro/mvn/bin/mvn similarity index 100% rename from dist/src/main/distro/bin/mvn rename to dist/src/main/distro/mvn/bin/mvn diff --git a/dist/src/main/distro/bin/mvn.cmd b/dist/src/main/distro/mvn/bin/mvn.cmd similarity index 100% rename from dist/src/main/distro/bin/mvn.cmd rename to dist/src/main/distro/mvn/bin/mvn.cmd diff --git a/dist/src/main/distro/bin/mvn.conf b/dist/src/main/distro/mvn/bin/mvn.conf similarity index 84% rename from dist/src/main/distro/bin/mvn.conf rename to dist/src/main/distro/mvn/bin/mvn.conf index bf4fec844..871e27045 100644 --- a/dist/src/main/distro/bin/mvn.conf +++ b/dist/src/main/distro/mvn/bin/mvn.conf @@ -18,6 +18,9 @@ main is org.apache.maven.cli.MavenCli from plexus.core set maven.conf default ${maven.home}/conf +set logback.configurationFile default ${maven.conf}/logging/logback-mvn.xml +set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml + [plexus.core] load ${maven.conf}/logging optionally ${maven.home}/lib/ext/*.jar diff --git a/dist/src/main/distro/bin/mvnDebug b/dist/src/main/distro/mvn/bin/mvnDebug similarity index 100% rename from dist/src/main/distro/bin/mvnDebug rename to dist/src/main/distro/mvn/bin/mvnDebug diff --git a/dist/src/main/distro/bin/mvnDebug.cmd b/dist/src/main/distro/mvn/bin/mvnDebug.cmd similarity index 100% rename from dist/src/main/distro/bin/mvnDebug.cmd rename to dist/src/main/distro/mvn/bin/mvnDebug.cmd diff --git a/dist/src/main/distro/conf/logging/logback-client.xml b/dist/src/main/distro/mvn/conf/logging/logback-client.xml similarity index 100% rename from dist/src/main/distro/conf/logging/logback-client.xml rename to dist/src/main/distro/mvn/conf/logging/logback-client.xml diff --git a/dist/src/main/distro/conf/logging/logback-mvnd.xml b/dist/src/main/distro/mvn/conf/logging/logback-server.xml similarity index 100% rename from dist/src/main/distro/conf/logging/logback-mvnd.xml rename to dist/src/main/distro/mvn/conf/logging/logback-server.xml diff --git a/dist/src/main/distro/conf/logging/logback.xml b/dist/src/main/distro/mvn/conf/logging/logback.xml similarity index 100% rename from dist/src/main/distro/conf/logging/logback.xml rename to dist/src/main/distro/mvn/conf/logging/logback.xml diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java index 9e291e606..f1543958b 100644 --- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java +++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java @@ -52,7 +52,7 @@ void version() throws IOException, InterruptedException { "-DforceStdout", "--raw-streams") .assertSuccess(); - String conf = parameters.mvndHome().resolve("conf").toString(); + String conf = parameters.mvndHome().resolve("mvn").resolve("conf").toString(); assertTrue( o.getMessages().stream().anyMatch(m -> m.toString().contains(conf)), "Output should contain " + conf); }