-
Notifications
You must be signed in to change notification settings - Fork 4
Migrate to Spring Boot 4.0 with Jackson 3.0 and GSON-based JJWT (minimal changes) #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
thomasturrell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot due to all the changes to the formatting and whitespace it is difficult to see the required changes.
Please can you undo any whitespace and formatting changes but keep the relevant changes
I've reworked the changes to minimize formatting impact. The new commit includes only functional changes without running the code formatter: Changes made:
What was avoided:
Note: There are still compilation errors due to Jackson 3.0 API changes (JsonDeserializer → ValueDeserializer, etc.) in custom serializers that need to be addressed separately. Commit: 67c3ddb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot I don't think that there should be multiple Jackson implementation.
Only use tools.jackson do not use com.fasterxml.jackson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the POM to ensure only one Jackson databind implementation is used (tools.jackson 3.0).
The exclusions now prevent jjwt-jackson from bringing in Jackson 2.x databind. The com.fasterxml.jackson.core:jackson-annotations dependency that appears is intentional - it comes transitively from Jackson 3.0 databind, as Jackson 3.0 kept the annotations package from Jackson 2.x for compatibility.
Dependency structure:
- ✅
tools.jackson.core:jackson-databind:3.0.2(our single databind implementation) - ✅
com.fasterxml.jackson.core:jackson-annotations:2.20(transitive from Jackson 3.0, for compatibility) - ❌
com.fasterxml.jackson.core:jackson-databind(excluded to prevent dual implementation)
Commit: df571f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import org.springframework.boot.jackson.autoconfigure.JacksonProperties; | ||
| import org.springframework.boot.jackson.autoconfigure.JsonMapperBuilderCustomizer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore Spring Boot Jackson import package
The autoconfiguration now imports JacksonProperties/JsonMapperBuilderCustomizer from org.springframework.boot.jackson.autoconfigure, but Spring Boot’s Jackson classes are still published under org.springframework.boot.autoconfigure.jackson (no boot.jackson package exists in 3.x/4.0). As written this class—and the client auto-configuration tests that were switched to the same package—won’t compile because the imported types cannot be resolved. Please keep the org.springframework.boot.autoconfigure.jackson imports.
Useful? React with 👍 / 👎.
…abind implementations Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
|
@copilot currently JJWT does not support Jackson 3 but Spring Boot 4 only has support for Jackson 3. Review POM files |
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Resolved the JJWT/Jackson compatibility issue by switching from Changes:
Result:
Commit: f086306 |
|
@copilot rebase on target branch dependabot/maven/org.springframework.boot-spring-boot-starter-parent-4.0.0 |
The rebase onto New base commits from target branch:
Resolved conflicts:
Current status: The branch will need to be force-pushed by someone with repository permissions, or you can pull the rebased branch if needed. |
|
Will be resolved in a different PR. Formatting changes confused the issue. |
Description
This PR migrates the project to Spring Boot 4.0, which requires Jackson 3.0. To resolve compatibility issues with JJWT (which doesn't support Jackson 3.0), the JWT serialization has been switched from Jackson-based to GSON-based implementation.
Branch has been rebased onto
dependabot/maven/org.springframework.boot-spring-boot-starter-parent-4.0.0to incorporate the latest changes from main, including automatic code formatting integration (#415), OkHttp BOM updates (#408), and 70+ other commits.Changes Made
Spring Boot Autoconfiguration Updates
JacksonAutoConfigurationimports fromorg.springframework.boot.autoconfigure.jacksontoorg.springframework.boot.jackson.autoconfigureWebClientAutoConfigurationwithCodecsAutoConfiguration(moved toorg.springframework.boot.http.codec.autoconfigure)Jackson2ObjectMapperBuilderCustomizertoJsonMapperBuilderCustomizerwith new builder API (directcustomize()method instead of returning lambdas)Jackson 3.0 Migration
com.fasterxml.jackson.core:jackson-databindtotools.jackson.core:jackson-databindin xapi-modeljackson-datatype-jsr310dependency (JSR-310 support integrated into Jackson 3.0 core)com.fasterxml.jackson.databind→tools.jackson.databindin 46 files (annotations remaincom.fasterxml.jackson.annotationfor compatibility)SimpleModuleimports totools.jackson.databind.module.SimpleModuleJJWT Compatibility Resolution
jjwt-jacksonwithjjwt-gsonto resolve Jackson version conflictjjwt-gsoninstead ofjjwt-jacksonjjwt-gsonDependency Structure
tools.jackson.core:jackson-databind:3.0.2(Jackson 3.0) for Spring Boot 4.0jjwt-gsonwith GSON for JSON serialization (no Jackson dependency)com.fasterxml.jackson.core:jackson-annotations:2.20for backward compatibilityAPI Changes
builder.postConfigurer()with direct builder method calls (configure(),addModule(),withCoercionConfig())withCoercionConfig(LogicalType, Consumer<MutableCoercionConfig>)Rebase and Conflict Resolution
dependabot/maven/org.springframework.boot-spring-boot-starter-parent-4.0.0Minimal Formatting Approach
tools.jacksonimportsRemaining Work
Custom serializers/deserializers need Jackson 3.0 API updates:
JsonDeserializer→ValueDeserializerJsonMappingException→DatabindExceptionSerializerProviderAPI changesCurrent status: Core import and configuration changes complete. JJWT compatibility resolved by switching to GSON. Branch rebased onto target with latest changes from main. Compilation errors remain in custom serializers due to Jackson 3.0 API differences that require additional investigation and updates.
Resolves #409
Checklist:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.