Home / Market / spring boot 4 migration

spring boot 4 migration

Migrate a Spring Boot 3.x application to Spring Boot 4.0 (Spring Framework 7, Jackson 3, modular starters, JSpecify). Use only for an explicit Boot 3.x to 4 migration, or to fix build or test failures caused by it, or to review one. Not for 3.x patch bumps or 4.0 to 4.1 upgrades; follow the target Boot version release notes and upgrade guide for those. Covers Maven and Gradle (Kotlin DSL, version catalogs).

skill★ 417940 dlgithubMITInstall in CosmosUpstream Source

Documentation & Preview

--- name: spring-boot-4-migration description: 'Migrate a Spring Boot 3.x application to Spring Boot 4.0 (Spring Framework 7, Jackson 3, modular starters, JSpecify). Use only for an explicit Boot 3.x to 4 migration, or to fix build or test failures caused by it, or to review one. Not for 3.x patch bumps or 4.0 to 4.1 upgrades; follow the target Boot version release notes and upgrade guide for those. Covers Maven and Gradle (Kotlin DSL, version catalogs).'

---

Spring Boot 3.x to 4.0 Migration

Step-by-step migration workflow. Topic details live in references/; load only the files relevant to the current step.

Rules

Workflow

  1. Detect the current state
  1. Migrate to the latest 3.5.x first. If the project is older than 3.5, upgrade to the latest 3.5.x, fix deprecation warnings, and get the tests green before touching 4.0. Never jump from 3.2 straight to 4.0.
  2. Baseline: run the full build and tests (./mvnw verify or ./gradlew build) and record failures that exist before migration.
  3. Bump to 4.0.x (parent/BOM or plugin version) and fix the build in this order, running the build after each item:
  4. Starters and modules: starters and removed features. Choose either the classic starters or the new modular ones; Boot 4 split the auto-configuration into many modules, and each technology now has its own *-test starter.
  5. Build files and third-party dependencies: build and dependencies and Kotlin/Java build config.
  6. Jackson 3 (new tools.jackson packages): Jackson 3. A temporary Jackson 2 compatibility module exists; plan to remove it.
  7. Core framework (JSpecify nullability, package relocations, logging, DevTools, PropertyMapper): core framework.
  8. Configuration properties (MongoDB, Spring Session, persistence, Kafka retry): configuration properties. Add spring-boot-properties-migrator temporarily to find renamed keys, and remove it afterwards.
  9. Web and messaging changes (trailing slash matching, HttpMessageConverters, Jersey, Kafka, RabbitMQ): web and messaging.
  10. Tests (Mockito/@MockBean replacement, @SpringBootTest changes, @PropertyMapping): testing.
  11. Actuator and observability modules, health probes: actuator and observability.
  12. Verify with the checklist, pitfalls and resources: full build, tests, startup, actuator health, a smoke test of the main endpoints, and native image build if used.

Build tool notes

Reference files

| File | Topic | |---|---| | 01-prerequisites.md | Minimum versions, pre-migration steps | | 02-starters-and-removed-features.md | Modular starters, renamed starters, removed servers/features | | 03-jackson-3.md | Jackson 3 packages, renames, compatibility module | | 04-core-framework.md | JSpecify, package moves, logging, DevTools, PropertyMapper | | 05-build-and-dependencies.md | Gradle plugin, Spring Retry, Authorization Server, Elasticsearch, Hibernate | | 06-configuration-properties.md | Renamed and restructured properties | | 07-web-and-messaging.md | Web framework, Kafka, RabbitMQ changes | | 08-testing.md | Test framework changes | | 09-actuator-and-observability.md | Actuator, Micrometer and OpenTelemetry modules | | 10-kotlin-and-java-build-config.md | Kotlin compiler and Java preview configuration | | 11-checklist-pitfalls-resources.md | Final checklist, pitfalls, links |

Automation

Use OpenRewrite (org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0, <https://docs.openrewrite.org/recipes/java/spring/boot4/upgradespringboot_4_0-community-edition>) when available, review the diff, and always fetch the version-specific official guide before editing.

Upstream sources (read before migrating)

Fetch the page for the target version; prefer it over this skill when they conflict.

For Boot 3.x patch bumps or Boot 4.0 to 4.1 upgrades, go directly to the target Boot version's release notes and upgrade guide using the official links above. These are dependency upgrades, not JDK migrations; do not route them to java-upgrade.

Related skills, each only if installed (otherwise use the fallback in parentheses):