Skip to content

Declare the servlet API compileOnlyApi in grails-web-core and grails-mimetypes - #16360

Merged
matrei merged 1 commit into
8.0.xfrom
fix/servlet-compile-only-api-extension-modules
Sep 21, 2026
Merged

matrei merged 1 commit into
8.0.xfrom
fix/servlet-compile-only-api-extension-modules

Conversation

@matrei

@matrei matrei commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #16356, as discussed in #16356 (comment).

grails-web-core (grails-web-servlets-module) and grails-mimetypes (grails-mimetypes-module) both ship a Groovy extension module whose extension classes take HttpServletRequest, HttpServletResponse, HttpSession and ServletContext in their signatures. The Groovy compiler loads extension modules from any compile classpath they are on, so a module that depends on either of them without the servlet API fails compileGroovy with the same NoClassDefFoundError that #16356 fixed for grails-converters.

Declare the servlet API compileOnlyApi in both, matching grails-converters, grails-controllers, grails-web-gsp and grails-web-taglib.

The runtime classpath is unchanged: in the generated Gradle module metadata jakarta.servlet-api appears on apiElements only, not on runtimeElements.

…mimetypes

Both modules ship a Groovy extension module with servlet types in its
signatures. The Groovy compiler loads extension modules from any compile
classpath they are on, so a consumer without the servlet API fails
compileGroovy with a NoClassDefFoundError. Follow-up to #16356, which
did the same for grails-converters.
@matrei
matrei merged commit 2c201cb into 8.0.x Sep 21, 2026
74 of 76 checks passed
@matrei
matrei deleted the fix/servlet-compile-only-api-extension-modules branch September 21, 2026 14:30
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.1710%. Comparing base (858a92a) to head (4df44b5).
⚠️ Report is 5 commits behind head on 8.0.x.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #16360        +/-   ##
==================================================
+ Coverage     56.1565%   56.1710%   +0.0145%     
- Complexity      21703      21705         +2     
==================================================
  Files            2124       2124                
  Lines          103078     103078                
  Branches        18447      18447                
==================================================
+ Hits            57885      57900        +15     
+ Misses          36922      36905        -17     
- Partials         8271       8273         +2     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants