feat: add Spring 6 REST adapter artifact - #16394
Open
SavitarC wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16394 +/- ##
============================================
- Coverage 60.90% 58.73% -2.18%
+ Complexity 11763 157 -11606
============================================
Files 1953 1976 +23
Lines 89266 89801 +535
Branches 13471 13559 +88
============================================
- Hits 54367 52741 -1626
- Misses 29319 31321 +2002
- Partials 5580 5739 +159
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
SavitarC
force-pushed
the
agent/fix-dubbo-rest-spring6
branch
from
July 26, 2026 06:08
f6f541b to
ea51d47
Compare
SavitarC
marked this pull request as ready for review
July 26, 2026 10:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed
dubbo-rest-spring6artifact by copying the legacy REST Spring adapter and applying only the Spring 6 / Jakarta Servlet compile-time adaptationsdubbo-rest-springartifact and its Spring 5 /javax.servletruntime behavior.artifactsdubbo-rest-springfrom thedubboanddubbo-all-shadedaggregate JARs so neither aggregate chooses an adapter@RequestMappingend-to-end, and Spring 6.1 compatibility coveragedubbo-test-rest-spring6.1under the JDK 17+ test profileWhy
dubbo-rest-springis compiled against Spring 5 andjavax.servlet. Spring Framework 6 changed the relevant MVC method descriptors tojakarta.servlet, so the legacy artifact cannot support that path without breaking Spring 5 compatibility.A separate artifact keeps the Spring 5 contract unchanged while providing a Spring 6 / Jakarta-compatible implementation.
Fixes #16387.
Dependency selection
Applications using Triple REST with Spring MVC annotations must explicitly select exactly one adapter. Applications that do not use the REST Spring integration may include neither.
Spring Boot 2 / Spring Framework 5
Spring Boot 3 / Spring Framework 6
When the Dubbo BOM manages these artifacts, the individual
<version>elements may be omitted.Having both REST Spring adapters on one classpath is an unsupported configuration. This version does not provide runtime conflict detection; users must ensure the classpath contains at most one adapter.
Scope
This PR is limited to the Spring 6 artifact split, build/distribution metadata, marker resources, and the tests needed to validate that split. It intentionally does not include:
FrameworkModelinitialization rollback or cleanup changesValidation
dubbo-rest-spring58 tests, 11 skipped, 0 failuresdubbo-rest-spring652 tests, 0 failures@RequestMappingcompatibility: 1 test, 0 failuresFileTest: 8 tests, 0 failuresdubboanddubbo-all-shadedbinary/source JARs contain neither REST Spring adapter23cd268bb1) with-Ddubbo.version=3.3.7-SNAPSHOT -Dspring.version=6.1.5 -Ddubbo.rest.spring6=true:dubbo-samples-triple-rest-springmvc: provider registered 48 REST mappings; all 36ConsumerITtests passeddubbo-samples-triple-rest-spring-security: provider registered the Spring MVC REST mappings; bothResourceServerITtests passed/demo/helloreturns404 Invoker not found, confirming the explicit-selection behaviorgit diff --checkpassedCurrent CI coordination
The samples jobs in this PR currently check out
apache/dubbo-samples@masterand do not enable-Ddubbo.rest.spring6=true. Because apache/dubbo-samples#1297 is still open and its profile is opt-in, the Java 21 samples job tests the aggregate without a REST Spring adapter and fails with404 Invoker not found.The cancelled samples-result job and skipped Jacoco jobs are downstream consequences of that samples failure. The adapter tests, unit tests, and integration-test jobs are green. The cross-repository check cannot become green until the samples ref/profile is available to the workflow or equivalent merge coordination is accepted.