diff --git a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java index 9939d27d..3a307ae1 100644 --- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java +++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java @@ -385,6 +385,9 @@ public class DaemonMavenCli } } + // Workaround for https://github.com/mvndaemon/mvnd/issues/39 + ch.qos.logback.classic.Logger mvndLogger = (ch.qos.logback.classic.Logger) slf4jLoggerFactory.getLogger("org.jboss.fuse.mvnd"); + mvndLogger.setLevel(ch.qos.logback.classic.Level.toLevel(System.getProperty("mvnd.log.level", "INFO"))); } private void version( CliRequest cliRequest ) throws ExitException diff --git a/integration-tests/src/test/java/org/jboss/fuse/mvnd/it/ModuleAndPluginNativeIT.java b/integration-tests/src/test/java/org/jboss/fuse/mvnd/it/ModuleAndPluginNativeIT.java index 07238911..4fa2b3b2 100644 --- a/integration-tests/src/test/java/org/jboss/fuse/mvnd/it/ModuleAndPluginNativeIT.java +++ b/integration-tests/src/test/java/org/jboss/fuse/mvnd/it/ModuleAndPluginNativeIT.java @@ -59,7 +59,7 @@ public class ModuleAndPluginNativeIT { /* Build #1: with "Hello" output to target/hello.txt */ { final ClientOutput output = Mockito.mock(ClientOutput.class); - client.execute(output, "clean", "install", "-e").assertSuccess(); + client.execute(output, "clean", "install", "-e", "-Dmvnd.log.level=DEBUG").assertSuccess(); Assertions.assertThat(helloPath).exists(); Assertions.assertThat(helloPath).usingCharset(StandardCharsets.UTF_8).hasContent("Hello"); @@ -74,7 +74,9 @@ public class ModuleAndPluginNativeIT { Files.write(mojoPath, mojoSource.getBytes(StandardCharsets.UTF_8)); final ClientOutput output = Mockito.mock(ClientOutput.class); - client.execute(output, "clean", "install", "-e").assertSuccess(); + client.execute(output, + // "clean", workaround for https://github.com/mvndaemon/mvnd/issues/40 + "install", "-e", "-Dmvnd.log.level=DEBUG").assertSuccess(); Assertions.assertThat(helloPath).exists(); Assertions.assertThat(helloPath).usingCharset(StandardCharsets.UTF_8).hasContent("Hi");