Skip to content

Make jcl-over-slf4j an optional dependency of transport-apache - #2231

Merged
slachiewicz merged 1 commit into
masterfrom
agent/jcl-over-slf4j-optional
Oct 31, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/jcl-over-slf4j-optional

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Fixes #2174.

maven-resolver-transport-apache no longer passes jcl-over-slf4j on to its consumers. Through maven-core (provided) it reached plugin classpaths next to commons-logging and tripped banDuplicateClasses. The application now picks the JCL implementation:

  • The Maven distribution already declares jcl-over-slf4j in apache-maven/pom.xml (3.10.x and master), so lib/ keeps the same content.
  • maven-resolver-supplier-mvn3 and -mvn4 declare it themselves, so supplier users see no change.
  • Other code that runs the Apache transport with no JCL on the classpath gets NoClassDefFoundError: org/apache/commons/logging/LogFactory and must add jcl-over-slf4j or commons-logging 1.3+. Maven 4's maven-testing and maven-cli depend on transport-apache directly, so they may want the same explicit dependency.

Verified: a consumer of transport-apache plus commons-logging:1.3.5, mvn dependency:list → only commons-logging provides org.apache.commons.logging.

@slachiewicz slachiewicz added the enhancement New feature or request label Oct 26, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review October 31, 2026 09:00
A library should not choose the JCL implementation for its consumers:
the transitive bridge clashed with commons-logging on plugin classpaths.
The Maven distribution declares jcl-over-slf4j itself; the suppliers
now declare it too. Do not make it transitive again.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. The fix is correct: making jcl-over-slf4j optional in transport-apache, adding it explicitly to both suppliers, and managing its version through the BOM are all consistent with the project's established pattern for slf4j artifacts.

The downstream impact on maven-testing and maven-cli (which depend on transport-apache directly) is properly documented in the PR body — those modules will need an explicit JCL dep, but that is an expected and acceptable consequence of this change.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@slachiewicz
slachiewicz merged commit 3a755b3 into master Oct 31, 2026
26 checks passed
@slachiewicz
slachiewicz deleted the agent/jcl-over-slf4j-optional branch October 31, 2026 10:45
@github-actions github-actions Bot added this to the 2.0.25 milestone Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jcl-over-slf4j is considered deprecated, replace directly with commons-logging 1.3.0+

2 participants