jamesfredley opened a new pull request, #15354:
URL: https://github.com/apache/grails-core/pull/15354

   ## Summary
   
   This PR upgrades Grails Core to **Spring Boot 4.0.1** and **Spring Framework 
7.0.2**, bringing major framework updates and compatibility fixes.
   
   ### Key Changes
   
   - Upgrade Spring Boot from 3.5.x to 4.0.1
   - Upgrade Spring Framework from 6.2.x to 7.0.2
   - Update all affected module imports and APIs for compatibility
   - Add vendored Spring Framework code for removed theme support (required by 
GSP)
   
   ## Breaking Changes in Spring Boot 4 / Spring Framework 7
   
   ### Package Relocations (Spring Boot 4)
   
   Spring Boot 4 restructured its autoconfigure modules. The following classes 
moved:
   
   | Class | Old Package | New Package |
   |-------|-------------|-------------|
   | `DataSourceAutoConfiguration` | 
`org.springframework.boot.autoconfigure.jdbc` | 
`org.springframework.boot.jdbc.autoconfigure` |
   | `ReactorAutoConfiguration` | 
`org.springframework.boot.autoconfigure.reactor` | 
`org.springframework.boot.reactor.autoconfigure` |
   | `HibernateJpaAutoConfiguration` | 
`org.springframework.boot.autoconfigure.orm.jpa` | 
`org.springframework.boot.hibernate.autoconfigure` |
   | `AnnotationConfigServletWebServerApplicationContext` | 
`org.springframework.boot.web.servlet.context` | 
`org.springframework.boot.web.server.servlet.context` |
   
   ### Removed APIs
   
   | Removed | Replacement/Fix |
   |---------|-----------------|
   | `SecurityProperties.DEFAULT_FILTER_ORDER` | Hardcoded value `-100` in 
`GrailsFilters` |
   | `AnnotationConfigServletWebApplicationContext` | Use 
`GenericWebApplicationContext` for testing |
   | `DispatcherServlet` theme support | Vendored Spring Framework theme 
classes |
   | `MappedInterceptor.matches(String, PathMatcher)` | Use 
`matches(HttpServletRequest)` |
   | `HandlerAdapter.getLastModified()` | Method deprecated (removed from 
interface) |
   
   ### Constructor Changes (Spring Framework 7)
   
   - `DefaultTransactionStatus` now requires 8 parameters (added 
`transactionName` and `nested`)
   
   ## Files Changed
   
   ### Core Module Updates
   - `ApplicationClassInjector.groovy` - Updated excluded auto-configuration 
class paths
   - `GrailsApplicationCompilerAutoConfiguration.java` - Updated 
DataSourceAutoConfiguration path
   - `ControllersAutoConfiguration.java` - Import reorganization for new 
packages
   - `GrailsFilters.java` - Removed SecurityProperties dependency, added 
DEFAULT_FILTER_ORDER constant
   
   ### Testing Support
   - `GrailsApplicationBuilder.groovy` - Use GenericWebApplicationContext 
instead of AnnotationConfigServletWebApplicationContext
   - `MockApplicationContext.java` - Added 
`getBeanProvider(ParameterizedTypeReference)` method
   - `AbstractGrailsTagTests.groovy` - Added static constants for removed theme 
attributes
   - `TransactionalTransformSpec.groovy` - Updated DefaultTransactionStatus 
constructor calls
   - `DefaultUrlCreatorTests.groovy` - Fixed ambiguous method overloading for 
setCharacterEncoding
   
   ### URL Mappings
   - `UrlMappingsHandlerMapping.groovy` - Updated MappedInterceptor.matches() 
call signature
   - `UrlMappingsInfoHandlerAdapter.groovy` - Deprecated getLastModified() 
method
   
   ### Build Configuration
   - `grails-data-hibernate5/boot-plugin/build.gradle` - Added spring-boot-jdbc 
and spring-boot-hibernate test dependencies
   
   ## Test Status
   
   ### Passing Tests
   - ✅ `grails-data-mongodb-spring-boot:test`
   - ✅ `grails-test-examples-app2:integrationTest`
   - ✅ `grails-test-examples-geb:integrationTest`
   - ✅ `grails-test-examples-gorm:integrationTest`
   - ✅ `grails-test-examples-demo33:integrationTest`
   - ✅ `grails-test-examples-cache:integrationTest`
   - ✅ `grails-test-examples-datasources:integrationTest`
   - ✅ `grails-core:test`
   - ✅ `grails-web-common:test`
   - ✅ `grails-web-url-mappings:test`
   - ✅ `grails-controllers:test`
   
   ### Known Failing Tests (External Plugin Issue)
   
   The following integration tests fail due to an incompatibility in the 
**external** `grails-spring-security` plugin (version 7.0.1-SNAPSHOT):
   
   - ❌ `grails-test-examples-app1:integrationTest`
   - ❌ `grails-test-examples-app3:integrationTest`
   - ❌ `grails-test-examples-exploded:integrationTest`
   
   **Root Cause:**
   ```
   groovy.lang.MissingMethodException: No signature of method: 
   static grails.plugin.springsecurity.ReflectionUtils.getApplication() 
   is applicable for argument types: () values: []
   ```
   
   This is a compatibility issue in the `grails-spring-security` plugin that 
needs to be addressed in that repository separately. The plugin's 
`ReflectionUtils.getApplication()` method is missing or has changed signature.
   
   **Action Required:** The `grails-spring-security` plugin needs to be updated 
for Spring Boot 4 compatibility before these test examples can pass.
   
   ## Migration Guide for Plugin Authors
   
   If you maintain a Grails plugin, you may need to update for Spring Boot 4:
   
   1. **Check for removed autoconfigure imports** - Update any references to 
classes that moved packages
   2. **Update MappedInterceptor usage** - Use `matches(HttpServletRequest)` 
instead of `matches(String, PathMatcher)`
   3. **Check HandlerAdapter implementations** - `getLastModified()` is no 
longer part of the interface
   4. **Update transaction status code** - `DefaultTransactionStatus` 
constructor changed
   5. **Check SecurityProperties usage** - `DEFAULT_FILTER_ORDER` constant was 
removed
   
   ## Checklist
   
   - [x] Code compiles without errors
   - [x] Core unit tests pass
   - [x] Integration tests pass (except those dependent on external 
spring-security plugin)
   - [x] Changes documented in PR description
   - [ ] External plugin (`grails-spring-security`) needs separate update


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to