MAT-10132: update spring boot (from 3.5.14 to 4.0.6)#357
Open
etan-sb wants to merge 2 commits into
Open
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
jkotanchik-SB
approved these changes
Jun 23, 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.
MADiE PR Template
Jira Ticket: MAT-10132
(Optional) Related Tickets:
Summary
Spring Boot 4 + Jackson 3 Upgrade Notes — madie-java-models
Part of the fleet-wide SB 3.5.14 → 4.0.6 + Jackson 2 → 3 migration. Common patterns live in
madie-fhir-service/SPRING_BOOT_4_UPGRADE.md; this file records only what was specific to this repo.This library is the linchpin of the Jackson 3 migration: it owns
VersionJsonSerializer, the custom(de)serializer on
Measure.version/CqlLibrary.version. It must be built and published before anyconsumer can move to Jackson 3.
Version
0.9.6-SNAPSHOT→0.10.0-SNAPSHOTpom.xml
springboot.version3.5.14→4.0.6.spring-boot-dependencies:${springboot.version}BOM import in<dependencyManagement>(manages Spring Framework 7 + Jackson 3 versions).jackson-databindgroupcom.fasterxml.jackson.core→tools.jackson.core(version dropped, BOM-managed);
jackson-annotationsstays oncom.fasterxml.jackson.core(BOM-managed). Removed the
fasterxml.jackson.versionproperty.org.springframework.boot:spring-boot-jackson— provides@JacksonComponent, which the basicspring-boot-starterdoes not pull transitively.maven-surefire-plugin2.22.1→3.5.2(see Test infra below).Source — Jackson 3 API changes
VersionJsonSerializer:JsonSerializer→tools.jackson.databind.ValueSerializer;JsonDeserializer→
ValueDeserializer;SerializerProvider→SerializationContext;JsonGenerator/JsonParser→tools.jackson.core; inside the deserializerjp.getCodec().readTree(jp)(removed in Jackson 3) →ctxt.readTree(jp);@JsonComponent→@JacksonComponent; droppedthrows IOException(Jackson 3exceptions are unchecked).
Measure.java/CqlLibrary.java: the databind-level@JsonSerialize/@JsonDeserializeimportsmoved
com.fasterxml.jackson.databind.annotation.*→tools.jackson.databind.annotation.*. The ~90core annotations elsewhere (
@JsonProperty,@JsonFormat,@JsonTypeInfo, etc.) are unchanged —jackson-annotations keeps the
com.fasterxml.jackson.annotationpackage.Test infrastructure
maven-surefire-plugin:2.22.1cannot launch under the JUnit Platform 6.x that the SB4BOM pulls in (
NoClassDefFoundError: PreconditionViolationException) → bumped to3.5.2.junit:juniton the classpath, surefire selectedthe JUnit 4 provider and silently skipped all JUnit 5 Jupiter
@Testmethods. Bumping surefiremakes them run for the first time, which surfaced two latent issues unrelated to Jackson:
ModelTypeTestasserted US Core"6.0.1"while MAT-10030 (commit ffb0815) had changed the enum toreturn
"6.1.0"— the test had never executed. Fixed the assertion to"6.1.0".RequiredByOtherFieldValidatorTestused@ExtendWith(SpringExtension.class)with@Mockfields;SB4 removed
MockitoTestExecutionListener, so the mocks were null → switched toMockitoExtension.MeasurePopulationTest) to JUnit 5.MeasureScoringValidatorTest:ObjectMapper→tools.jackson.databind; dropped the now-uncheckedthrowsclause;InvalidFormatException→tools.jackson.databind.exc.VersionDeserializeroriginally didVersion.parse(node.asText()). Jackson 3'sasText()/asString()is strict — it throws
JsonNodeExceptionon a non-scalar node, whereas Jackson 2 leniently returned"". Some consumer fixtures storeversionas an object{major,minor,revisionNumber}(not a string),so under Jackson 3 the deserializer threw, was caught, and returned
null→ downstreamNullPointerExceptiononMeasure.getVersion(). Restored the Jackson-2 lenient behavior explicitly:Version.parse(node.isValueNode() ? node.asString() : "")(a non-scalar node →""→Version.parse("")→new Version(), exactly as before). This surfaced only when fhir-service ran itsreal Measure-deserialization tests against the Jackson-3 lib — java-models' own unit tests did not cover
the object-form fixture.
Result
mvn clean installgreen — 153 tests. Installed to local~/.m2(publish to GitHub Packages at cutover).All Submissions
DevSecOps
If there is a question if this PR has a security or infrastructure impact, please contact the Security or DevOps engineer assigned to this project to discuss it further.
Reviewers
By Approving this PR you are attesting to the following: