Autopilot run: Spring Boot 4.1 upgrade, SB4-2..SB4-4¶
Request:docs/plans/plan-spring-boot-4-upgrade.md SB4-2..SB4-4, one commit per task; json-contract/ fixtures unchanged; SB4-3 falls back into SB4-4 on a jackson-annotations conflict
SB4-2: orphan pom comments removed. SB4-4: static mapper in UnauthorizedException, comment on the enum setting
—
Land: full gates
mvn verify green after each task; LINE coverage 96.38% (SB4-2), 96.24% (SB4-4, clean verify)
—
Gate 2 (owner)
Push (owner accepted that the first Boot 4 start is on prod: no local Postgres)
—
CI + smoke
CI green (build, tests, Docker, deploy); mock-test.sh 22/22; health 200; /actuator/prometheus 403 from nginx/Cloudflare in front of the app (external block, not the app)
Trigger 3: Jackson 3.1.7 needs jackson-annotations 2.21, while Boot 3.5.0 pins 2.19.0.
Steps 2.3–2.4 were carried into SB4-4.
SB4-4, dependencies:
Spring Boot 4.1.2 (Framework 7.0.10, Security 7.1.2, Hibernate 7.4.13, Jackson 3.1.7, Liquibase 5.0.4).
New starters: webmvc, jackson, restclient, liquibase, cache.
New test starters: webmvc-test, security-test, cache-test.
springdoc 3.2.0.
BOM-overriding pins removed.
SB4-4, JSON:
One settings source, config/JsonMappers.java, used both by the MVC mapper (through a JsonMapperBuilderCustomizer in ConfigBean) and by code-built mappers.
All Jackson usage moved to tools.jackson; JsonProcessingException/IOException catches became JacksonException with the same fallbacks.
UpdateUserSettingsRequest disables its all-args constructor as a Jackson creator. Jackson 3 picked that constructor and lost the null-vs-absent locale signal; UserSettingsServiceImplTest.request_jsonNullVersusAbsentLocale failed before the fix and passes after.
SB4-4, framework fixes:
Error reads the constraint leaf name through the public jakarta.validation.Path API instead of Hibernate Validator's internal PathImpl.
WebSecurityConfig takes the Security 7 Supplier<? extends Authentication> override signature; no matcher or rule changed.
Contract:
The 31 SB4-1 fixtures are byte-identical (git diff --exit-code 02fe8707 -- api/src/test/resources/json-contract).
trailingTokens_throw is enabled with its assertion unchanged.
Docs:tech-strategy.md and CLAUDE.md now say Spring Boot 4.x. The ADR-0033 changelog records the jjwt backend, the SB4-3 fold and the Liquibase decision.
SB4-2:org.json 20231013 is now on the JWT parse path, which reads untrusted input before the signature is verified. Bump json-lib.version in a separate change after checking the latest release and its CVEs.
SB4-4:MaskingUtils.cloneObject falls back to the original object, which the caller then masks in place. This hazard existed before the upgrade; fix it in its own task.
SB4-4:Error leaf name for container-element paths (e.g. list[0]) through Path.Node.getName() is not covered by a fixture.
Plan step 3.6: resolved 2026-10-29. The first prod start (2026-10-28 16:09) logged no renamed keys and Liquibase reported "no changesets to execute", so spring-boot-properties-migrator was removed. The one new-looking warning, Serializing PageImpl instances as-is, was already logged once per start on 3.5.