diff --git a/client/pom.xml b/client/pom.xml index 61bbea33d..85007dc11 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -49,6 +49,10 @@ org.slf4j slf4j-simple + + org.slf4j + jul-to-slf4j + org.graalvm.nativeimage svm diff --git a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java index 8501ed638..b920c008e 100644 --- a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java +++ b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java @@ -59,6 +59,7 @@ import org.mvndaemon.mvnd.common.logging.TerminalOutput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.slf4j.bridge.SLF4JBridgeHandler; import static org.mvndaemon.mvnd.client.DaemonParameters.LOG_EXTENSION; @@ -146,6 +147,9 @@ public static void main(String[] argv) throws Exception { } } + // Install JUL -> SLF4j bridge + SLF4JBridgeHandler.install(); + int exitCode = 0; boolean noBuffering = batchMode || parameters.noBuffering(); try (TerminalOutput output = new TerminalOutput(noBuffering, parameters.rollingWindowSize(), logFile)) { 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 615b8f685..22402e1ba 100644 --- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java +++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java @@ -431,7 +431,7 @@ private Process startDaemonProcess(String daemonId, ClientOutput output) { Environment.MVND_HOME.addSystemProperty(args, mvndHome.toString()); 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")); + args.add("-Dclassworlds.conf=" + mvndHome.resolve("bin").resolve("mvnd-daemon.conf")); Environment.MVND_JAVA_HOME.addSystemProperty( args, parameters.javaHome().toString()); 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 c12fc40df..eacdce341 100644 --- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java +++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java @@ -243,7 +243,7 @@ public Path multiModuleProjectDirectory(Path projectDir) { public Path logbackConfigurationPath() { return property(Environment.MVND_LOGBACK) .orDefault(() -> mvndHome() - .resolve("mvn/conf/logging/logback-server.xml") + .resolve("mvn/conf/logging/logback-daemon.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 1dcb00f31..3798b16f5 100644 --- a/dist-m39/src/main/provisio/maven-distro.xml +++ b/dist-m39/src/main/provisio/maven-distro.xml @@ -31,6 +31,9 @@ + + + diff --git a/dist-m40/src/main/provisio/maven-distro.xml b/dist-m40/src/main/provisio/maven-distro.xml index 3d92c9eb3..99673caca 100644 --- a/dist-m40/src/main/provisio/maven-distro.xml +++ b/dist-m40/src/main/provisio/maven-distro.xml @@ -31,6 +31,9 @@ + + + diff --git a/dist/src/main/distro/bin/mvnd-client.conf b/dist/src/main/distro/bin/mvnd-client.conf index 03462d3d1..35244ace2 100644 --- a/dist/src/main/distro/bin/mvnd-client.conf +++ b/dist/src/main/distro/bin/mvnd-client.conf @@ -19,6 +19,7 @@ main is org.mvndaemon.mvnd.client.DefaultClient from plexus.core set maven.home default ${mvnd.home}/mvn set maven.conf default ${maven.home}/conf +set java.util.logging.config.file default ${maven.conf}/logging/java.util.logging.properties set logback.configurationFile default ${maven.conf}/logging/logback-client.xml set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml diff --git a/dist/src/main/distro/bin/mvnd-server.conf b/dist/src/main/distro/bin/mvnd-daemon.conf similarity index 89% rename from dist/src/main/distro/bin/mvnd-server.conf rename to dist/src/main/distro/bin/mvnd-daemon.conf index 508eb143c..4b32b4a26 100644 --- a/dist/src/main/distro/bin/mvnd-server.conf +++ b/dist/src/main/distro/bin/mvnd-daemon.conf @@ -19,7 +19,8 @@ main is org.mvndaemon.mvnd.daemon.Server from plexus.core 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 java.util.logging.config.file default ${maven.conf}/logging/java.util.logging.properties +set logback.configurationFile default ${maven.conf}/logging/logback-daemon.xml set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml [plexus.core] diff --git a/dist/src/main/distro/mvn/bin/mvn.conf b/dist/src/main/distro/mvn/bin/mvn.conf index 871e27045..df99d78f6 100644 --- a/dist/src/main/distro/mvn/bin/mvn.conf +++ b/dist/src/main/distro/mvn/bin/mvn.conf @@ -18,6 +18,7 @@ main is org.apache.maven.cli.MavenCli from plexus.core set maven.conf default ${maven.home}/conf +set java.util.logging.config.file default ${maven.conf}/logging/java.util.logging.properties set logback.configurationFile default ${maven.conf}/logging/logback-mvn.xml set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml diff --git a/dist/src/main/distro/mvn/conf/logging/java.util.logging.properties b/dist/src/main/distro/mvn/conf/logging/java.util.logging.properties new file mode 100644 index 000000000..b21a7d3b7 --- /dev/null +++ b/dist/src/main/distro/mvn/conf/logging/java.util.logging.properties @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/dist/src/main/distro/mvn/conf/logging/logback-client.xml b/dist/src/main/distro/mvn/conf/logging/logback-client.xml index df8748633..abadf029d 100644 --- a/dist/src/main/distro/mvn/conf/logging/logback-client.xml +++ b/dist/src/main/distro/mvn/conf/logging/logback-client.xml @@ -20,6 +20,7 @@ | mvnd client log configuration --> + diff --git a/dist/src/main/distro/mvn/conf/logging/logback-server.xml b/dist/src/main/distro/mvn/conf/logging/logback-daemon.xml similarity index 100% rename from dist/src/main/distro/mvn/conf/logging/logback-server.xml rename to dist/src/main/distro/mvn/conf/logging/logback-daemon.xml