Skip to content

Exclude commons-logging from managed dependencies #37890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sdeleuze opened this issue Oct 16, 2023 · 5 comments
Closed

Exclude commons-logging from managed dependencies #37890

sdeleuze opened this issue Oct 16, 2023 · 5 comments

Comments

@sdeleuze
Copy link
Contributor

sdeleuze commented Oct 16, 2023

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).

@snicoll
Copy link
Member

snicoll commented Oct 16, 2023

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
Copy link
Member

wilkinsona commented Oct 16, 2023

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
Copy link
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.

@philwebb philwebb changed the title Exclude commons-logging:commons-logging from managed dependencies Exclude commons-logging from managed dependencies Oct 16, 2023
@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Oct 16, 2023
@snicoll
Copy link
Member

snicoll commented Oct 17, 2023

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!

@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Oct 18, 2023
@philwebb philwebb added this to the 3.x milestone Oct 18, 2023
@wilkinsona
Copy link
Member

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

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2025
@wilkinsona wilkinsona removed the type: enhancement A general enhancement label Apr 25, 2025
@wilkinsona wilkinsona removed this from the 3.x milestone Apr 25, 2025
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

No branches or pull requests

5 participants