Fix some logging issues

This commit is contained in:
Guillaume Nodet
2020-10-15 16:47:12 +02:00
parent 2ac9199bd0
commit ee17eed282
12 changed files with 429 additions and 207 deletions

View File

@@ -33,37 +33,22 @@ public class SingleModuleTest extends SingleModuleNativeIT {
"single-module",
":single-module:org.apache.maven.plugins:" + MvndTestUtil.plugin(props, "maven-clean-plugin")
+ ":clean {execution: default-clean}");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module:org.apache.maven.plugins:" + MvndTestUtil.plugin(props, "maven-resources-plugin")
+ ":resources {execution: default-resources}");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module:org.apache.maven.plugins:" + MvndTestUtil.plugin(props, "maven-compiler-plugin")
+ ":compile {execution: default-compile}");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module:org.apache.maven.plugins:" + MvndTestUtil.plugin(props, "maven-resources-plugin")
+ ":testResources {execution: default-testResources}");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module:org.apache.maven.plugins:" + MvndTestUtil.plugin(props, "maven-compiler-plugin")
+ ":testCompile {execution: default-testCompile}");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module:org.apache.maven.plugins:" + MvndTestUtil.plugin(props, "maven-surefire-plugin")
@@ -72,9 +57,6 @@ public class SingleModuleTest extends SingleModuleNativeIT {
"single-module",
":single-module:org.apache.maven.plugins:" + MvndTestUtil.plugin(props, "maven-install-plugin")
+ ":install {execution: default-install}");
inOrder.verify(output).projectStateChanged(
"single-module",
":single-module");
inOrder.verify(output).projectFinished("single-module");
}

View File

@@ -191,6 +191,7 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
final Path mvndPropertiesPath = testDir.resolve("mvnd.properties");
final Path localMavenRepository = deleteDir(testDir.resolve("local-maven-repo"));
final Path settingsPath = createSettings(testDir.resolve("settings.xml"));
final Path logback = Paths.get("src/test/resources/logback.xml").toAbsolutePath();
final TestLayout layout = new TestLayout(
testDir,
mvndPropertiesPath,
@@ -199,7 +200,7 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
multiModuleProjectDirectory,
Paths.get(System.getProperty("java.home")).toAbsolutePath().normalize(),
localMavenRepository, settingsPath,
mvndHome.resolve("conf/logging/logback.xml"));
logback);
final TestRegistry registry = new TestRegistry(layout.registry());
return new MvndResource(layout, registry, isNative, timeoutMs);

View File

@@ -0,0 +1,57 @@
<!--
Copyright 2019 the original author or authors.
Licensed 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.
-->
<!--
| Local developer build logging configuration.
| * console log shows overall info+ build messages and project errors
| * overall build.log file includes all build log messages
| * project-specific build.log files include corresponding project build log messages
-->
<configuration>
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator" />
<!--
| write project-specific build log messages to ${project.build.directory}/build.log files
-->
<appender name="MEM" class="org.jboss.fuse.mvnd.logging.smart.ProjectBuildLogAppender">
<pattern>[%level] %msg%n</pattern>
</appender>
<appender name="DAEMON" class="ch.qos.logback.core.FileAppender">
<file>${mvnd.home}/daemon/daemon-${daemon.uid}.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %.-1level %msg%n</pattern>
</encoder>
</appender>
<logger name="org.jboss.fuse.mvnd.daemon" level="DEBUG" additivity="false">
<appender-ref ref="DAEMON" />
</logger>
<logger name="org.jboss.fuse.mvnd.builder.SmartBuilder" level="DEBUG"/>
<logger name="Sisu" level="INFO" />
<!-- suppress annoying @threadSafe and checksum failure warning messages -->
<logger name="org.apache.maven.lifecycle.internal.builder.BuilderCommon" level="ERROR" />
<logger name="org.eclipse.aether.internal.impl.WarnChecksumPolicy" level="ERROR" />
<root level="${consoleLevel:-info}">
<appender-ref ref="MEM" />
</root>
</configuration>