jamesfredley commented on PR #15541:
URL: https://github.com/apache/grails-core/pull/15541#issuecomment-4200648563

   ## Jackson 3.x Migration Assessment
   
   ### Can Grails move to Jackson 3.x (tools.jackson:jackson-bom:3.1.0)?
   
   **No - not feasible at this time.**
   
   ### Why Not
   
   Jackson 3.x is a breaking release that changed both Maven coordinates and 
Java package names:
   
   | | Jackson 2.x | Jackson 3.x |
   |---|---|---|
   | **Group ID** | `com.fasterxml.jackson.*` | `tools.jackson.*` |
   | **Package** | `com.fasterxml.jackson.annotation.*` | 
`tools.jackson.annotation.*` |
   | **Package** | `com.fasterxml.jackson.databind.*` | 
`tools.jackson.databind.*` |
   
   ### Impact on Grails
   
   Direct `com.fasterxml.jackson` references in the Grails codebase:
   - **10 Java source files** (17 imports) - mostly in `grails-forge`
   - **14 Groovy source files** (15 imports) - `grails-views-gson` tests, 
`grails-datamapping-core`, HAL renderer tests
   - **9 build.gradle files** - dependency declarations
   
   But the real blocker is the **transitive ecosystem**:
   - **Spring Framework 7.0.x** uses `com.fasterxml.jackson` (Jackson 2.x) for 
its JSON message converters
   - **Spring Boot 4.0.x** ships separate modules: `spring-boot-jackson2` (for 
2.x) and `spring-boot-jackson` (for 3.x)
   - **GORM** JSON serialization relies on 
`com.fasterxml.jackson.databind.ObjectMapper`
   - **Grails JSON Views** (`grails-views-gson`) are built around Jackson 2.x 
APIs
   
   Switching to Jackson 3.x would require:
   1. ALL imports changed from `com.fasterxml.jackson.*` to `tools.jackson.*`
   2. ALL dependency declarations changed from `com.fasterxml.jackson:*` to 
`tools.jackson:*`
   3. Spring Boot auto-configuration switched from `spring-boot-jackson2` to 
`spring-boot-jackson`
   4. Every downstream plugin that uses Jackson must also migrate
   
   ### Current State (Correct)
   
   Spring Boot 4.0.5 manages both Jackson versions:
   - `jackson-2-bom.version=2.21.2` (for `com.fasterxml.jackson` 2.x artifacts)
   - `jackson-bom.version=3.1.0` (for `tools.jackson` 3.x artifacts)
   
   After removing Grails' jackson override (commit `95f902f9`), Spring Boot now 
manages the Jackson 2.x version. This is the correct approach - Grails stays on 
Jackson 2.x managed by Boot, and can migrate to 3.x in a future release when 
the Spring ecosystem has fully adopted it.
   
   ### Recommendation
   
   Wait for Spring Framework and the broader ecosystem to complete their 
Jackson 3.x migration before attempting this in Grails. Track the Spring Boot 
Jackson 3.x migration progress at the Spring Boot issue tracker.


-- 
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