Skip to content

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adinauer
Copy link

@adinauer adinauer commented Aug 12, 2025

I tried duplicating the springBoot3 files to make opentelemetry-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 for org.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 for org.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 separate resources 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 and spring-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

Copy link

linux-foundation-easycla bot commented Aug 12, 2025

CLA Not Signed

@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Aug 12, 2025
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test native This label can be applied to PRs to trigger them to run native tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant