diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 426bd70a67b0..dac0617fc959 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -70,6 +70,13 @@ under the License. ${slf4jVersion} runtime + + + org.slf4j + jul-to-slf4j + ${slf4jVersion} + runtime + org.apache.maven.resolver maven-resolver-connector-basic diff --git a/impl/maven-cli/pom.xml b/impl/maven-cli/pom.xml index 72b4554c1c92..9e9de4421e52 100644 --- a/impl/maven-cli/pom.xml +++ b/impl/maven-cli/pom.xml @@ -195,6 +195,10 @@ under the License. org.slf4j slf4j-api + + org.slf4j + jul-to-slf4j + commons-cli commons-cli diff --git a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java index 5ec158321dbd..56c7fb83d7b3 100644 --- a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java +++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java @@ -90,6 +90,7 @@ import org.jline.terminal.impl.AbstractPosixTerminal; import org.jline.terminal.spi.TerminalExt; import org.slf4j.LoggerFactory; +import org.slf4j.bridge.SLF4JBridgeHandler; import org.slf4j.spi.LocationAwareLogger; import static java.util.Objects.requireNonNull; @@ -428,6 +429,10 @@ protected Consumer doDetermineWriter(C context) { } protected void activateLogging(C context) throws Exception { + if (!SLF4JBridgeHandler.isInstalled()) { + SLF4JBridgeHandler.removeHandlersForRootLogger(); + SLF4JBridgeHandler.install(); + } context.slf4jConfiguration.activate(); if (context.options().failOnSeverity().isPresent()) { String logLevelThreshold = context.options().failOnSeverity().get(); diff --git a/pom.xml b/pom.xml index fc17ca354224..f1549469538d 100644 --- a/pom.xml +++ b/pom.xml @@ -510,6 +510,11 @@ under the License. ${slf4jVersion} true + + org.slf4j + jul-to-slf4j + ${slf4jVersion} + ch.qos.logback logback-classic