Skip to content

Migrate to Spring Boot 4, Jackson 3, and modern build tooling#1

Open
v3rm0n wants to merge 4 commits into
masterfrom
spring-boot-4
Open

Migrate to Spring Boot 4, Jackson 3, and modern build tooling#1
v3rm0n wants to merge 4 commits into
masterfrom
spring-boot-4

Conversation

@v3rm0n

@v3rm0n v3rm0n commented May 29, 2026

Copy link
Copy Markdown

What & why

Completes the Spring Boot 4 migration on this branch and gets the full build green — compile, SpotBugs, Checkstyle, Shadow jar, and all integration tests — on Gradle 9 / Java 25. As a deliberate part of the migration, Jackson is moved from 2.x to 3.x (tools.jackson).

Builds on the existing Upgrade Gradle commit already on this branch.

Changes

Build tooling

  • Shadow plugin johnrengelman 8.1.1gradleup 9.4.2 (the old fork calls the removed FileCopyDetails.mode on Gradle 9); rewrote the protobuf dependency filter for the new API.
  • SpotBugs plugin 6.0.26.5.5, pinned tool 4.9.8 so it can read Java 25 class files (major version 69).
  • Extended the Java 17 source/target compatibility branch to cover Spring Boot 4.x.

Spring Boot 4

  • Added spring-boot-kafka (KafkaAutoConfiguration was split out of spring-boot-autoconfigure).
  • Updated Flyway/Validation autoconfigure imports to their new split-module packages (org.springframework.boot.flyway.autoconfigure.*, org.springframework.boot.validation.autoconfigure.*).

Jackson 3

  • Switched jackson-databind from com.fasterxml.jackson.core to tools.jackson.core and migrated every ObjectMapper import to tools.jackson.databind. JsonMapper extends ObjectMapper, so the call sites (writeValueAsBytes, readValue) are unchanged.

SpotBugs findings

  • Removed three now-useless @SuppressFBWarnings (rules no longer triggered).
  • Fixed a real concurrency bug: TkmsRegisteredMessagesCollector.enabled is now volatile.
  • Broadened the generated-proto exclusion to the StoredMessage inner classes.

Test infrastructure

  • Replaced EOL wurstmeister/kafka:2.12-2.4.1 (its docker-in-docker port trick breaks on the current Docker API) with bitnamilegacy/kafka:3.6.0 using static port mappings.
  • KafkaConfiguration.createTopic now waits until topic metadata has fully propagated (every partition has an elected leader) before returning, fixing a startup topic-validation race that flaked under full-suite load.

Verification

./gradlew build passes. Integration tests ran green across three consecutive --rerun-tasks runs (~2 min each) to confirm the topic-propagation fix is deterministic.

Reviewer notes

  • This targets lightyeardev:master (the fork), not upstream transferwise.
  • CI matrix needs updating: .github/workflows/build.yml still pins Spring Boot 3.4.6/3.5.0, but build.libraries.gradle now references SB4-only artifacts and Jackson 3. The matrix should move to 4.x to match this branch.
  • Local runs needed the Colima VM at ≥6 GiB (default 2 GiB OOM-kills a Kafka broker mid-suite); not a repo change, just an env note.

🤖 Generated with Claude Code

v3rm0n and others added 2 commits May 29, 2026 09:26
Complete the Spring Boot 4 migration and get the full build (compile,
SpotBugs, Checkstyle, Shadow jar, integration tests) passing on Gradle 9
/ Java 25.

Build tooling:
- Shadow plugin johnrengelman 8.1.1 -> gradleup 9.4.2 (Gradle 9 compat),
  rewrite the protobuf dependency filter for the new API.
- SpotBugs plugin 6.0.2 -> 6.5.5, pin tool 4.9.8 so it can read Java 25
  class files (major version 69).
- Extend the Java 17 source/target compatibility branch to Spring Boot 4.x.

Spring Boot 4:
- Add spring-boot-kafka (KafkaAutoConfiguration split out of core).
- Update Flyway/Validation autoconfigure imports to their new
  split-module packages.

Jackson 3:
- Switch jackson-databind coordinate from com.fasterxml.jackson.core to
  tools.jackson.core and migrate every ObjectMapper import to
  tools.jackson.databind. JsonMapper extends ObjectMapper, so call sites
  are unchanged.

SpotBugs findings:
- Remove three useless @SuppressFBWarnings (now-undetected rules).
- Fix a real concurrency bug: make TkmsRegisteredMessagesCollector.enabled
  volatile.
- Broaden the generated-proto exclusion to the StoredMessage inner classes.

Test infrastructure:
- Replace EOL wurstmeister/kafka:2.12-2.4.1 (broke on modern Docker API)
  with bitnamilegacy/kafka:3.6.0 using static port mappings.
- Make KafkaConfiguration.createTopic wait until topic metadata has
  propagated (all partitions have a leader) before returning, fixing a
  startup topic-validation race that flaked under full-suite load.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@v3rm0n v3rm0n marked this pull request as ready for review May 29, 2026 13:15
v3rm0n and others added 2 commits May 29, 2026 17:07
Drop the exact patch/build qualifier (temurin-25.0.2+10.0.LTS) so mise
resolves the latest Temurin 25.x instead of being pinned to a single
build that has to be bumped by hand.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The migration drops Spring Boot 3 support, so reduce the build matrix to
Spring Boot 4.0.6 (3.4.6/3.5.0 can no longer resolve the SB4-only
artifacts and Jackson 3).

Replace the EOL wurstmeister/kafka:2.12-2.2.0 service containers with
bitnamilegacy/kafka:3.6.0 so the Kafka 4.1.2 client from Spring Boot 4
has a compatible broker. Bitnami needs explicit advertised listeners
(wurstmeister auto-derived them), so set KAFKA_CFG_ADVERTISED_LISTENERS
to each service's network alias.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants