Repository navigation
Backport #13363: restore the java.util.logging root handlers after an invocation - #13364
Open
slachiewicz wants to merge 1 commit into
Open
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
…cation activateLogging() replaces the handlers of the java.util.logging root logger with SLF4JBridgeHandler and nothing put them back. When Maven runs inside another JVM (embedded, resident, ToolProvider), the root logger is that JVM's: its logging went to Maven's SLF4J, and once Maven's realm was closed every java.util.logging record failed with NoClassDefFoundError: org/slf4j/spi/LocationAwareLogger. invoke() now restores the handlers like it restores the system properties and the context class loader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gnodet
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #13363 to
maven-4.0.x: a clean cherry-pick of 5a4fb08.LookupInvoker.invoke()now restores the handlers of thejava.util.loggingroot logger, whichactivateLogging()replaces withSLF4JBridgeHandler. That handler otherwise stays installed in the host JVM when Maven runs embedded, resident or throughToolProvider, and once Maven's realm is closed everyjava.util.loggingrecord of the host fails withNoClassDefFoundError: org/slf4j/spi/LocationAwareLogger(#13362).Verified on this branch:
MavenInvokerTest.restoresJavaUtilLoggingRootHandlerspasses, and so do all 752 maven-cli tests, includingResidentMavenInvokerTest.Fixes #13362 for 4.0.x.
🤖 Generated with Claude Code