Duplicate Spring Boot 3 files for Spring Boot 4 #14415
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I tried duplicating the
springBoot3files to makeopentelemetry-spring-boot-starterwork with Spring Boot 4.While I was able to deploy a modified version to my local Maven repository and confirm it fixes the
ClassNotFoundExceptionfororg.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration, I was unable to make it coexist with Spring Boot 3 configuration.IIRC Spring Boot 2 used
spring.factoriesand support fororg.springframework.boot.autoconfigure.AutoConfiguration.importswas 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 separateresourcesdirectories, 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-autoconfigureandspring-boot-startermodules 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