Move mvnd logback config file into [MVND_HOME]/conf and use the standard name for the mvn specific config file, fixes #226

This commit is contained in:
Guillaume Nodet
2020-11-16 11:43:21 +01:00
parent 7879a057a5
commit b6cc70e923
7 changed files with 23 additions and 24 deletions

View File

@@ -203,7 +203,7 @@ public class DaemonParameters {
public Path logbackConfigurationPath() { public Path logbackConfigurationPath() {
return property(Environment.LOGBACK_CONFIGURATION_FILE) return property(Environment.LOGBACK_CONFIGURATION_FILE)
.orDefault(() -> mvndHome().resolve("mvn/conf/logging/logback.xml").toString()) .orDefault(() -> mvndHome().resolve("conf/logback.xml").toString())
.orFail() .orFail()
.asPath(); .asPath();
} }

View File

@@ -193,7 +193,7 @@ exec "$JAVACMD" \
$MAVEN_OPTS \ $MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \ $MAVEN_DEBUG_OPTS \
-classpath "${DAEMON_JAR}" \ -classpath "${DAEMON_JAR}" \
"-Dlogback.configurationFile=${MVND_HOME}/mvn/conf/logging/logback.xml" \ "-Dlogback.configurationFile=${MVND_HOME}/conf/logback.xml" \
"-Dmvnd.home=${MVND_HOME}" \ "-Dmvnd.home=${MVND_HOME}" \
"-Dmaven.home=${MVND_HOME}/mvn" \ "-Dmaven.home=${MVND_HOME}/mvn" \
"-Dlibrary.jansi.path=${MVND_HOME}/mvn/lib/jansi-native" \ "-Dlibrary.jansi.path=${MVND_HOME}/mvn/lib/jansi-native" \

View File

@@ -1,6 +1,6 @@
<!-- <!--
Copyright 2020 the original author or authors. Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@@ -28,7 +28,20 @@
<!-- <!--
| write project-specific build log messages to ${project.build.directory}/build.log files | write project-specific build log messages to ${project.build.directory}/build.log files
--> -->
<appender name="CONSOLE" class="org.mvndaemon.mvnd.logging.internal.SimpleAppender" /> <appender name="MEM" class="org.mvndaemon.mvnd.logging.smart.ProjectBuildLogAppender">
<pattern>[%level] %msg%n</pattern>
</appender>
<appender name="DAEMON" class="ch.qos.logback.core.FileAppender">
<file>${mvnd.daemon.storage}/daemon-${daemon.uid}.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %.-1level %msg%n</pattern>
</encoder>
</appender>
<logger name="org.mvndaemon.mvnd.daemon" level="DEBUG" additivity="false">
<appender-ref ref="DAEMON" />
</logger>
<logger name="Sisu" level="INFO" /> <logger name="Sisu" level="INFO" />
@@ -37,6 +50,6 @@
<logger name="org.eclipse.aether.internal.impl.WarnChecksumPolicy" level="ERROR" /> <logger name="org.eclipse.aether.internal.impl.WarnChecksumPolicy" level="ERROR" />
<root level="${consoleLevel:-info}"> <root level="${consoleLevel:-info}">
<appender-ref ref="CONSOLE" /> <appender-ref ref="MEM" />
</root> </root>
</configuration> </configuration>

View File

@@ -192,7 +192,7 @@ exec "$JAVACMD" \
$MAVEN_OPTS \ $MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \ $MAVEN_DEBUG_OPTS \
-classpath "${CLASSWORLDS_JAR}" \ -classpath "${CLASSWORLDS_JAR}" \
"-Dlogback.configurationFile=${MAVEN_HOME}/conf/logging/logback-mvn.xml" \ "-Dlogback.configurationFile=${MAVEN_HOME}/conf/logging/logback.xml" \
"-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \ "-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
"-Dmvnd.home=${MAVEN_HOME}" \ "-Dmvnd.home=${MAVEN_HOME}" \
"-Dmaven.home=${MAVEN_HOME}" \ "-Dmaven.home=${MAVEN_HOME}" \

View File

@@ -177,7 +177,7 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
%MAVEN_OPTS% ^ %MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^ %MAVEN_DEBUG_OPTS% ^
-classpath %CLASSWORLDS_JAR% ^ -classpath %CLASSWORLDS_JAR% ^
"-Dlogback.configurationFile=%MAVEN_HOME%\conf\logging\logback-mvn.xml" ^ "-Dlogback.configurationFile=%MAVEN_HOME%\conf\logging\logback.xml" ^
"-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^ "-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^
"-Dmvnd.home=%MAVEN_HOME%" ^ "-Dmvnd.home=%MAVEN_HOME%" ^
"-Dmaven.home=%MAVEN_HOME%" ^ "-Dmaven.home=%MAVEN_HOME%" ^

View File

@@ -1,6 +1,6 @@
<!-- <!--
Copyright 2019 the original author or authors. Copyright 2020 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@@ -28,20 +28,7 @@
<!-- <!--
| write project-specific build log messages to ${project.build.directory}/build.log files | write project-specific build log messages to ${project.build.directory}/build.log files
--> -->
<appender name="MEM" class="org.mvndaemon.mvnd.logging.smart.ProjectBuildLogAppender"> <appender name="CONSOLE" class="org.mvndaemon.mvnd.logging.internal.SimpleAppender" />
<pattern>[%level] %msg%n</pattern>
</appender>
<appender name="DAEMON" class="ch.qos.logback.core.FileAppender">
<file>${mvnd.daemon.storage}/daemon-${daemon.uid}.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %.-1level %msg%n</pattern>
</encoder>
</appender>
<logger name="org.mvndaemon.mvnd.daemon" level="DEBUG" additivity="false">
<appender-ref ref="DAEMON" />
</logger>
<logger name="Sisu" level="INFO" /> <logger name="Sisu" level="INFO" />
@@ -50,6 +37,6 @@
<logger name="org.eclipse.aether.internal.impl.WarnChecksumPolicy" level="ERROR" /> <logger name="org.eclipse.aether.internal.impl.WarnChecksumPolicy" level="ERROR" />
<root level="${consoleLevel:-info}"> <root level="${consoleLevel:-info}">
<appender-ref ref="MEM" /> <appender-ref ref="CONSOLE" />
</root> </root>
</configuration> </configuration>

View File

@@ -236,7 +236,6 @@ limitations under the License.</inlineHeader>
<exclude>**/README.*</exclude> <exclude>**/README.*</exclude>
<exclude>**/.cache/**</exclude> <exclude>**/.cache/**</exclude>
<exclude>**/.gitkeep</exclude> <exclude>**/.gitkeep</exclude>
<exclude>**/conf/logging/logback.xml</exclude>
<exclude>**/mvnd.properties.template</exclude> <exclude>**/mvnd.properties.template</exclude>
<exclude>**/m2.conf</exclude> <exclude>**/m2.conf</exclude>
<exclude>**/mvnd</exclude> <exclude>**/mvnd</exclude>