mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-11 13:39:32 +00:00
Allow increasing mvnd.log.level via CLI
This commit is contained in:
@@ -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
|
private void version( CliRequest cliRequest ) throws ExitException
|
||||||
|
@@ -59,7 +59,7 @@ public class ModuleAndPluginNativeIT {
|
|||||||
/* Build #1: with "Hello" output to target/hello.txt */
|
/* Build #1: with "Hello" output to target/hello.txt */
|
||||||
{
|
{
|
||||||
final ClientOutput output = Mockito.mock(ClientOutput.class);
|
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).exists();
|
||||||
Assertions.assertThat(helloPath).usingCharset(StandardCharsets.UTF_8).hasContent("Hello");
|
Assertions.assertThat(helloPath).usingCharset(StandardCharsets.UTF_8).hasContent("Hello");
|
||||||
@@ -74,7 +74,9 @@ public class ModuleAndPluginNativeIT {
|
|||||||
Files.write(mojoPath, mojoSource.getBytes(StandardCharsets.UTF_8));
|
Files.write(mojoPath, mojoSource.getBytes(StandardCharsets.UTF_8));
|
||||||
|
|
||||||
final ClientOutput output = Mockito.mock(ClientOutput.class);
|
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).exists();
|
||||||
Assertions.assertThat(helloPath).usingCharset(StandardCharsets.UTF_8).hasContent("Hi");
|
Assertions.assertThat(helloPath).usingCharset(StandardCharsets.UTF_8).hasContent("Hi");
|
||||||
|
Reference in New Issue
Block a user