Skip to content

jcl-over-slf4j is still exposed through Maven Core's Resolver compatibility path #14019

Open

Description

@hazendaz

Affected version

3.10.1

Bug description

Title

jcl-over-slf4j is still exposed through Maven Core's Resolver compatibility path

Description

The changes intended to remove jcl-over-slf4j from Maven's exposed dependencies have not actually eliminated it from the Maven runtime.

Although the dependency was made optional in Resolver, Maven Core subsequently reintroduced it through the Maven 3.10.1 compatibility code. As a result, the bridge is still present in the effective runtime dependency graph and continues to leak through Maven Core.

See example using enforcer to block jcl-over-slf4j from maven-core within a maven plugin.

ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.6.3:enforce (enforce-clean) on project coveralls-maven-plugin:
[ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.BannedDependencies failed with message:
[ERROR] Do not use obsolete logging libraries.  Prefer slf4j/logback and override slf4j libraries for replacements.  Use only commons-logging when needed and no overrides from any of the major logging providers.
[ERROR] com.github.hazendaz.maven:coveralls-maven-plugin:maven-plugin:5.1.1-SNAPSHOT
[ERROR]    org.apache.maven:maven-core:jar:3.10.1
[ERROR]       org.apache.maven:maven-resolver-provider:jar:3.10.1
[ERROR]          org.slf4j:jcl-over-slf4j:jar:2.0.20 <--- banned via the exclude/include list

This defeats the original objective of removing the dependency. Making it optional in one location does not solve the problem if Maven Core brings it back through another path.

Proposed direction

My original recommendation was to move away from jcl-over-slf4j rather than simply hide or make the dependency optional.

Commons Logging already provides the appropriate logging abstraction and delegation mechanism, and moving to it would avoid carrying the additional JCL-to-SLF4J bridge. It also offers a better-performing approach than retaining the bridge.

I would strongly prefer addressing the underlying logging dependency arrangement rather than continuing to add compatibility-specific exceptions that reintroduce the dependency.

Expected outcome

  • jcl-over-slf4j should no longer be present in Maven Core's effective runtime dependency graph.
  • Resolver's Maven 3.10.1 compatibility code should not reintroduce the dependency.
  • The original logging migration should be completed consistently across Maven Core and Resolver.
  • Verify the actual Maven distribution/runtime dependencies, rather than checking only whether the dependency is optional or absent from an individual POM.

The current implementation gives the appearance of having removed the dependency while retaining it in the actual runtime. That is not a completed migration.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. harshab054 commented on Nov 17, 2026

    @harshab054
    Contributor

    I investigated the dependency leak in Maven 3.10.1 and confirmed that "maven-resolver-provider" exposes "jcl-over-slf4j" as a non-optional runtime dependency.

    Resolver 2.0.25 already marks this dependency optional, with the expectation that the application provides a JCL implementation. Making it optional in Maven's provider POM removes it from downstream consumers' dependency trees while preserving it on the provider's own test classpath.

    I also verified that Apache HttpClient 4.5.14 requires the JCL API, and that "commons-logging:1.3.4" can provide that API while delegating logging to SLF4J.

    There seem to be two possible scopes:

    1. Make "jcl-over-slf4j" optional in the Maven 3.10.x provider, preventing it from leaking to downstream consumers.
    2. Replace the bridge with standard Commons Logging throughout Maven, including the CLI distribution.

    Which direction would you prefer? I would like to align the fix with the intended scope before submitting a revised PR.

  3. cstamas commented on Nov 17, 2026

    @cstamas
    Member

    Anyone care to make a PR for upcoming 3.10.2? (don't forget to test with Resolver 2.0.26-SNAPSHOT)

  4. modified the milestones: 3.10.2, 3.10.3 on Nov 17, 2026
  5. ksrathod commented on Nov 23, 2026

    @ksrathod

    PR #14110 is ready for review on maven-3.10.x. It replaces jcl-over-slf4j with Commons Logging 1.4.0 in the resolver provider and the CLI. Wagon HTTP 3.5.3 also pulls the bridge in transitively, so the patch excludes it there and adds a Maven Enforcer rule to catch it if it returns.

    The downstream Enforcer check reproduced the reported failure on Maven 3.10.2 and passed against the patched 3.10.3-SNAPSHOT with Resolver 2.0.26. In the assembled distribution, only commons-logging-1.4.0.jar provides LogFactory, and it delegates to Maven’s SLF4J logger. Both the native and Wagon HTTP transports downloaded fresh JARs with matching checksums. An application embedding Maven Core also resolved a JAR into an empty local repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions