Undertow Support for Grails 8 - #15985
Merged
Merged
Conversation
Contributor
Author
|
Assuming all checks pass, we can activate this PR for review. |
Contributor
Author
|
We may want to consider deprecating Undertow support, but in the mean time Grails 8 needs to support it. This work was based on the suggestion in the upstream ticket where the Spring team suggested forking the modularised modules before they were removed: spring-projects/spring-boot#50381 (comment) I'm re-adding this until the jboss-fuse fork is actually published. Once that is published, we can either eliminate the vendored files (adopt their fork) or deprecate the support in our preferred timeline. |
jdaugherty
force-pushed
the
feature/undertow
branch
from
July 15, 2026 02:53
3c4327d to
9d27ffd
Compare
jdaugherty
force-pushed
the
feature/undertow
branch
from
July 15, 2026 03:00
9d27ffd to
3e40c9b
Compare
jdaugherty
marked this pull request as ready for review
July 15, 2026 12:48
✅ All tests passed ✅🏷️ Commit: 77723a6 Learn more about TestLens at testlens.app. |
jamesfredley
approved these changes
Jul 15, 2026
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.
Description
Restores Undertow as an embedded servlet container option for Grails 8.
Spring Boot 4 removed its Undertow support (
spring-boot-starter-undertow) before GA becauseUndertow did not yet support Servlet 6.1, which Spring Boot 4 requires. Undertow has since shipped
Servlet 6.1 support (
io.undertow:undertow-core2.4.x plus the newio.undertow.eeservlet andwebsockets artifacts). This PR brings that support back to Grails:
grails-undertow-spring-boot(grails-undertow/spring-boot): thespring-boot-undertowmodule vendored from Spring Boot 4.0.0-M1 (the last tag it existed in), repackaged as
org.apache.grails.undertow.coreand adapted to the Spring Boot 4.1 APIs. Spring Framework 7removed the reactive Undertow bridge classes (
UndertowHttpHandlerAdapteret al.), so those arevendored from Spring Framework 6.2.19 and adapted. Per-file Spring license headers are retained,
a module
META-INF/NOTICEis included, the rootNOTICEis updated, and the upstream sourceURLs are recorded in
build.gradle(same approach as the vendored Spring ORM Hibernate 5 support).grails-undertow(grails-undertow/plugin, packageorg.apache.grails.undertow.plugin):a Grails plugin that puts the vendored Undertow web server support and its dependencies on the
application classpath, so switching containers is a single dependency:
implementation 'org.apache.grails:grails-undertow'.grails-undertow(previously hidden and rejected with an error);
--servlet=undertowworks again and applies thenew plugin. The fail-fast rejection in
ContextFactoryis removed.undertow.version(2.4.2.Final),undertow-servlet.versionandundertow-websockets.version(2.0.1.Final,io.undertow.ee) are pinned independencies.gradle;both new modules are published and managed by
grails-bom. Spring Boot 4 no longer managesUndertow, so these pins are required.
server.undertow.max-http-post-sizedefaults to 2MB, matching Undertow 2.4'shardened
DEFAULT_MAX_ENTITY_SIZE(CVE-2024-3884, CVE-2024-4027). A non-positive value is stillhonored as an explicit opt-out to unlimited. This is called out in the upgrade notes.
Boot test fixtures were rewritten as self-contained equivalents (server start/stop, SSL, access
log, customizers, Spring MVC round-trip, autoconfiguration back-off). A new functional example app
(
grails-test-examples/undertow, mirroring the jetty example) verifies end-to-end that a Grailsapplication boots on Undertow and serves a full request/redirect/session cycle, including an
assertion that the running web server is the Undertow implementation.
pages updated for the renamed
grails-undertowfeature, andrun-appdocuments the Undertowalternative.
Fixes #
Contributor Checklist
Issue and Scope
8.0.x).Code Quality
./gradlew build --rerun-tasks../gradlew codeStyleand resolved any violations.Licensing and Attribution
Apache license header; the vendored Spring Boot / Spring Framework sources retain their original
Apache 2.0 license headers, with provenance documented in the module
META-INF/NOTICE, the rootNOTICE, andgrails-undertow/spring-boot/build.gradle.Documentation
server.undertow.max-http-post-sizedefault).