Skip to content

Exclude commons-logging from managed dependencies #37890

Not planned
@sdeleuze

Description

@sdeleuze
Contributor

Related to spring-projects/spring-framework#31322, it looks like org.apache.httpcomponents:httpclient has a transitive dependency on commons-logging:commons-logging which is a dependency that creates conflicts with Spring Framework own implementation, and even worse that breaks the native compilation (see for details on spring-projects/spring-framework#30575).

Discussing with @snicoll about that, we were wondering if it could be possible for Spring Boot dependency management to exclude commons-logging:commons-logging transitive dependency from the managed dependencies like org.apache.httpcomponents:httpclient (and potentially other ones).

Activity

snicoll

snicoll commented on Oct 16, 2023

@snicoll
Member

I also wonder if commons-logging could be a "banned dependency". I know the build has such capability so that we make sure only spring-jcl remains on the classpath for an app that uses our dependency management.

wilkinsona

wilkinsona commented on Oct 16, 2023

@wilkinsona
Member

Boot's own build bans commons-logging:commons-logging. We could do that for apps in Boot's Gradle plugin or we could go one better and automatically configure a dependency substitution so that org.springframework:spring-jcl is used in place of commons-logging:commons-logging.

I'm not sure there's much we can do for Maven. Could we add some configuration for the Enforcer plugin to spring-boot-starter-parent perhaps?

philwebb

philwebb commented on Oct 16, 2023

@philwebb
Member

I'm not sure we should try to configure the enforcer plugin but perhaps we can use our own plugin to check there isn't a commons-logging dependency.

changed the title [-]Exclude `commons-logging:commons-logging` from managed dependencies[/-] [+]Exclude commons-logging from managed dependencies[/+] on Oct 16, 2023
snicoll

snicoll commented on Oct 17, 2023

@snicoll
Member

I am not a big fan of having the enforcer plugin configured in the parent either. The route of using our own plugin sounds really interesting!

added and removed
for: team-meetingAn issue we'd like to discuss as a team to make progress
on Oct 18, 2023
added this to the 3.x milestone on Oct 18, 2023
wilkinsona

wilkinsona commented on Apr 25, 2025

@wilkinsona
Member

Framework 7 has dropped spring-jcl in favor of commons logging so this will become a non-issue in Boot 4.

removed this from the 3.x milestone on Apr 25, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sdeleuze@snicoll@philwebb@wilkinsona@spring-projects-issues

        Issue actions

          Exclude commons-logging from managed dependencies · Issue #37890 · spring-projects/spring-boot