Skip to content

Mark all Log4j2 dependencies as provided to fix SLF4J and Log4j2 classpath warnings#13

Merged
yeshan333 merged 3 commits intomainfrom
copilot/fix-slf4j-multiple-bindings-warning
Apr 3, 2026
Merged

Mark all Log4j2 dependencies as provided to fix SLF4J and Log4j2 classpath warnings#13
yeshan333 merged 3 commits intomainfrom
copilot/fix-slf4j-multiple-bindings-warning

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

The plugin's fat JAR bundles log4j-slf4j-impl, log4j-core, log4j-api, and log4j-1.2-api, which conflict with JMeter's own copies at runtime, producing SLF4J: Class path contains multiple SLF4J bindings and WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated warnings.

  • Changed log4j-slf4j-impl scope to provided, matching the existing pattern used for tika-core — both are already supplied by JMeter at runtime
  • Explicitly declared log4j-core, log4j-api, and log4j-1.2-api as provided scope at version 2.17.2 (matching JMeter 5.5) to prevent their classes and the Log4j2Plugins.dat cache file from being bundled in the fat JAR
  • Moved log4j.properties from src/main/resources/ to src/test/resources/ to prevent it from interfering with JMeter's logging configuration at runtime

Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix SLF4J multiple bindings warning in JMeter Mark log4j-slf4j-impl as provided to fix duplicate SLF4J binding warning Apr 3, 2026
Copilot AI requested a review from yeshan333 April 3, 2026 08:55
@yeshan333
Copy link
Copy Markdown
Owner

@copilot still have an wanring:
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 3, 2026

@copilot still have an wanring:
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of...

Fixed in a3b2c24. The "package scanning" warnings were caused by log4j-core classes and Log4j2Plugins.dat being bundled in the fat JAR, conflicting with JMeter's own copies. I've explicitly declared log4j-core, log4j-api, and log4j-1.2-api as provided scope (matching JMeter 5.5's version 2.17.2), and moved log4j.properties to test resources. The fat JAR now contains zero Log4j2 classes.

Copilot AI changed the title Mark log4j-slf4j-impl as provided to fix duplicate SLF4J binding warning Mark all Log4j2 dependencies as provided to fix SLF4J and Log4j2 classpath warnings Apr 3, 2026
Copy link
Copy Markdown
Owner

@yeshan333 yeshan333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yeshan333 yeshan333 marked this pull request as ready for review April 3, 2026 09:18
@gemini-code-assist
Copy link
Copy Markdown

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@yeshan333 yeshan333 merged commit f03f30f into main Apr 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

warning SLF4J: Found binding in

2 participants