-
Notifications
You must be signed in to change notification settings - Fork 987
Duplicate Spring Boot 3 files for Spring Boot 4 #14415
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
base: main
Are you sure you want to change the base?
Duplicate Spring Boot 3 files for Spring Boot 4 #14415
Conversation
|
🔧 The result from spotlessApply was committed to the PR branch. |
Since #14363 was resolved is this still relevant? |
My original suggestion was to close this PR in favor of #14416 but since you prefer implementing without the duplication, this PR might serve as a starting point, depending on how exactly support for Spring Boot 4 can be implemented. I'm not quite sure how to work around the shared |
have you considered using the conditional annotations to ensure that configuration class is enabled only for boot 3 or 4? We already have a bunch of |
I can take another look after my vacation and see if that helps with |
I tried duplicating the
springBoot3
files to makeopentelemetry-spring-boot-starter
work with Spring Boot 4.While I was able to deploy a modified version to my local Maven repository and confirm it fixes the
ClassNotFoundException
fororg.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration
, I was unable to make it coexist with Spring Boot 3 configuration.IIRC Spring Boot 2 used
spring.factories
and support fororg.springframework.boot.autoconfigure.AutoConfiguration.imports
was added in Spring Boot 3, so it was fine for those to coexist. For Spring Boot 4 however, there'd have to be a mechanism of configuring whether to use imports from the Spring Boot 3 vs 4 sources. Event with having separateresources
directories, I wasn't able to make this work since they still end up in the same JAR.I might be wrong here^, if so, we can continue on this approach. If this holds true, I recommend duplicating the
spring-boot-autoconfigure
andspring-boot-starter
modules for Spring Boot 4.I'll open another PR for this shortly. I opened this PR more for documenting what I tried, but recommend closing it in favor of #14416.Attempt at fixing #14363