Skip to content

Compatible Spring Boot 4 - #4

Closed
SavitarC wants to merge 9 commits into
3.3from
compatible-spring-boot-4
Closed

SavitarC wants to merge 9 commits into
3.3from
compatible-spring-boot-4

Conversation

@SavitarC

Copy link
Copy Markdown
Owner

What changed

This PR adds Spring Boot 4 compatibility across Dubbo Spring Boot modules while keeping the existing default / Spring Boot 2 and Spring Boot 3 paths isolated.

Spring Boot 4 profile and dependency management

  • Add the root spring-boot-4 profile with Spring Boot 4, Spring Framework 7, Tomcat 11, JUnit 6, SLF4J / Logback, Jackson, and the new Spring Boot 4 split artifacts.
  • Add dubbo-spring-boot-4-autoconfigure and dubbo-spring-boot-4-starter to the reactor, artifact list, BOM, and dependency-all coverage.
  • Add module-local dependency management for Spring Boot related modules so default / Spring Boot 1 / 2 / 3 builds are not polluted by the active Spring Boot 4 profile.
  • Replace implicit JDK 17 based profile selection with explicit spring-boot-3 and spring-boot-4 profile wiring where Spring Boot version selection matters.

New Spring Boot 4 autoconfigure and starter modules

  • Add dubbo-spring-boot-4-autoconfigure.
  • Add Spring Boot 4 Triple auto-configuration.
  • Add Spring Boot 4 Zipkin auto-configuration using the new Boot 4 HTTP client / RestTemplate / WebClient layout.
  • Register Boot 4 auto-configurations in both spring.factories and AutoConfiguration.imports.
  • Add dubbo-spring-boot-4-starter and wire tracing Zipkin starters to include Boot 4 auto-configuration under the spring-boot-4 profile.

Spring Boot version conditions

  • Add SpringBoot4Condition and SpringBootBefore4Condition.
  • Tighten SpringBoot3Condition so Boot 4 no longer matches the Boot 3 condition.
  • Keep the existing Zipkin auto-configuration limited to Spring Boot versions before 4.
  • Add dependency check auto-configurations for Spring Boot 3 and Spring Boot 4 profile validation.

Spring Boot 4 API compatibility

  • Split Spring Boot before-4 and Boot 4 source sets where APIs moved or changed.
  • Add Boot 4 variants for Dubbo tag interceptors using Jakarta servlet APIs.
  • Add Boot 4 variants for REST Spring support classes.
  • Add a Boot 4 variant of DubboHealthIndicator using the new Spring Boot health contributor package.
  • Update actuator auto-configurations to detect both pre-Boot 4 and Boot 4 health indicator APIs.
  • Update metrics and observation auto-configuration ordering for the new Spring Boot 4 package names.

Demo and compatibility modules

  • Add Spring Boot 3 / 4 profile wiring to Spring Boot demos, servlet demo, IDL demo, and MCP server demo.
  • Align demo Spring Boot Maven plugin versions with the active Spring Boot profile.
  • Add Spring Boot 4 support to dubbo-config-spring.
  • Keep legacy Spring Boot compatible modules pinned to their own managed dependency sets.

Supporting compatibility fixes

  • Handle SLF4J 2 style logger factory detection.
  • Replace removed Spring JSON UTF-8 media type constants.
  • Avoid deprecated / moved Spring Boot actuator and observation class references where needed.
  • Adjust JDK-specific tests for newer JUnit behavior.
  • Fix test data that is invalid under newer JDK networking behavior.
  • Remove an unused JUnit Platform runner dependency.
  • Exclude conflicting logging bindings from Spring Boot 3 security test dependencies.

Tests and guards

  • Add FileTest guards for Spring Boot 3 / 4 profile dependency isolation, Boot 4 artifacts, BOM coverage, source-set wiring, starter wiring, and auto-configuration resource registration.
  • Add Spring Boot 3 dependency isolation and observation regression tests.
  • Add Spring Boot condition tests.
  • Add Spring Boot 4 Triple and Zipkin auto-configuration tests.
  • Update actuator endpoint and health indicator tests for explicit test context setup and current metadata values.

Why

Spring Boot 4 changes several compatibility boundaries:

  • Spring Framework 7 and Tomcat 11 require separate dependency management.
  • Several Spring Boot artifacts were split or moved.
  • Actuator health, metrics, observation, REST client, and HTTP client classes moved to new packages.
  • JDK 17+ is no longer a safe proxy for selecting the Spring Boot 3 or Spring Boot 4 code path.
  • Existing Spring Boot 2 / 3 modules can accidentally resolve newer managed dependencies when root profiles are active.

This PR makes the Spring Boot version boundaries explicit and adds regression guards so future dependency changes do not silently break default, Spring Boot 3, or Spring Boot 4 builds.

Verification

Validated with full reactor checks for the supported profiles:

  • Default profile / Spring Boot 2 baseline on JDK 8:

    • clean test verify
    • Result: build success, 7273 tests, 0 failures, 0 errors
  • Spring Boot 3 profile on JDK 25:

    • clean test verify -Pspring-boot-3,jacoco,jdk15ge-simple,!jdk15ge-add-open,skip-spotless
    • Result: build success, 7400 tests, 0 failures, 0 errors
  • Spring Boot 4 profile on JDK 25:

    • clean test verify -Pspring-boot-4,jacoco,jdk15ge-simple,!jdk15ge-add-open,skip-spotless
    • Result: build success, 7400 tests, 0 failures, 0 errors

Additional checks:

  • spotless:check for root and touched modules
  • git diff --check

@SavitarC

Copy link
Copy Markdown
Owner Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 236e9f4f9c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SavitarC
SavitarC force-pushed the compatible-spring-boot-4 branch from 318a8f9 to e3463d4 Compare May 18, 2026 05:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c9e1ea360

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SavitarC

Copy link
Copy Markdown
Owner Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SavitarC SavitarC closed this May 18, 2026
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

Successfully merging this pull request may close these issues.

1 participant