More screenshots
Works with the AI Agents you already use
Spring Boot 4 Upgrade: OpenRewrite + Post-Migration Fixer
Upgrade Spring Boot 3.x to 4 with OpenRewrite, then fix the compile and test errors the recipe leaves behind.
$18.99
Spring Boot 4 Upgrade: OpenRewrite + Post-Migration Fixer
Example session with this skill installed
Use the upgrade-spring-boot-4 skill to migrate this Maven project to Spring Boot 4. Use the pinned OpenRewrite versions, stop at each checkpoint so I can review, and write the migration report when the build is green.
- Read your context and instructions
- Compiled the spring boot 4
Migration to Spring Boot 4.0.8 complete. The full build is green (56 tests, 0 failures) and the report is at ./sb4-migration-report.md. Nothing was committed. I paused at each checkpoint that changed files so you could review and commit.
Summary
| Checkpoint | Status | Details |
|---|---|---|
| A: Preconditions | ✅ Passed | Spring Boot 3.5.6, Java 17 toolchain, JDK 21, Maven wrapper 3.9.11, clean tree, green baseline build. Created branch chore/spring-boot-4-upgrade. |
| B: Pre-migration scan | ✅ Nothing to fix | No Part 1 patterns found (e.g. KafkaProperties.buildProducerProperties(null)). |
| C: OpenRewrite | ✅ Applied | rewrite-maven-plugin 6.46.1 + rewrite-spring 6.37.1 (pinned, resolve from Maven Central). Recipe UpgradeSpringBoot_4_0. |
| C: Formatter | ✅ Applied | Project uses spring-javaformat; ran spring-javaformat:apply so the recipe output passes the format check. |
| C: Sanity checks (§5.5) | ⚠ 1 fix | The recipe bumped pom.xml but left build.gradle on plugin 3.5.6. Bumped it to 4.0.8. |
| Internal libraries | ➖ None | Only public Spring/Jakarta dependencies, so no versions needed from you. |
| D: Compile + catalogue fixes | ✅ Clean | test-compile passed. 0 known issues triggered. |
| E: Full build + report | ✅ Green | mvnw verify: Tests run: 56, Failures: 0, Errors: 0, Skipped: 2. BUILD SUCCESS. |
What changed (15 files, +52 / −37)
M pom.xml spring-boot-starter-parent 3.5.6 → 4.0.8, modular starters
M build.gradle org.springframework.boot 3.5.6 → 4.0.8 (sanity check)
M gradle/wrapper/gradle-wrapper.properties Gradle 8.14.3 → 8.14.5 (recipe)
M src/main/java/.../system/CacheConfiguration.java recipe changes
M src/test/java/.../owner/OwnerControllerTests.java recipe: test migrations
M src/test/java/.../owner/PetControllerTests.java
M src/test/java/.../vet/VetControllerTests.java
M src/test/java/.../PetClinicIntegrationTests.java
… 7 more test classes
sb4-migration-report.md (excerpt)
Connects securely to your tools. The creator never sees your data.
About this skill
Upgrading to Spring Boot 4 is more than a version bump. Modular auto-configuration, Jackson 3, Spring Framework 7, Hibernate 7, and the new test-starter split break builds in ways the OpenRewrite recipe alone does not fix. This skill makes your coding agent work through the migration step by step, with checks along the way:
-
Checks preconditions first: Boot 3.x, Java 17+, Gradle/Maven version, JDK compatibility, Java toolchain, Kotlin 2.2+, clean git tree, feature branch, green build.
-
Fixes known bad patterns before the rewrite, so the recipe doesn't leave them half-migrated.
-
Runs the official OpenRewrite Spring Boot 4.0 recipe. It uses a non-invasive Gradle init script (no build-file edits) or a one-line Maven command. It prefers the wrapper and handles Windows/PowerShell quoting.
-
Pins OpenRewrite versions that resolve from Maven Central. Newer OpenRewrite releases are moving to an authenticated repository and fail with Could not find org.openrewrite:rewrite-bom. The skill avoids this and explains the fallback.
-
Finds your internal libraries, corporate parent POMs, and convention plugins, and asks you for their Spring Boot 4–compatible versions. It never guesses.
-
Includes a catalogue of 25+ real post-migration errors with before/after fixes, covering:
-
o: modular starters (security, OAuth2, Kafka, Liquibase, WebMVC tests)
-
o: Jackson 2 → 3 (customizers, serializationInclusion, visibility, JsonNullable)
-
o: RestClient message converters
-
o: HttpHeaders no longer being a Map
-
o: @AutoConfigureObservability, Micrometer package moves
-
o: TestRestTemplate, MockMvc, and WebTestClient annotations; @Mock fields no longer initialised
-
o: Specification.unrestricted(), Hibernate 5 package removal
-
o: the OpenAPI generator (the recipe's version bump is too old to work)
-
o: OkHttp MockWebServer 3, Resilience4J in slice tests
-
o: Undertow removal
-
o: and more
-
Catches what the recipe gets wrong: Spring Boot versions left on 3.x in Gradle version catalogs, stale version pins that override the Spring Cloud BOM, and hard-coded versions it adds.
-
Runs your formatter after the rewrite (spring-javaformat, Spotless, ktlint), so formatter checks don't break the build.
-
Optional second step from 4.0 to the latest 4.x release.
-
Doesn't loop on slow builds: it stops and asks after two failed attempts on an unknown error.
-
Never commits. It pauses at five checkpoints so you can review and commit each phase separately.
-
Writes sb4-migration-report.md listing what changed, temporary measures to revert, remaining TODO-SB4 markers, new issues, and a suggested commit plan.
Tested end to end on six projects (Spring Boot 3.4/3.5 → 4.0.8), each ending with a green full build and all tests passing:
- spring-petclinic with Maven and with Gradle (Groovy DSL)
- spring-petclinic-rest (Maven, OpenAPI generator, Spring Security, Jackson customisation, 216 tests)
- spring-petclinic-microservices (Maven, 9 modules, Spring Cloud 2025.1, gateway, Resilience4J, OkHttp MockWebServer)
- spring-petclinic-kotlin (Kotlin 2.3, Gradle Kotlin DSL)
- a Gradle Kotlin DSL multi-module build with a version catalog and FAIL_ON_PROJECT_REPOS
It was also used by the author on internal production Gradle services. The catalogue's code fixes were also applied verbatim to a purpose-built project, then compiled and tested on Spring Boot 4. Where the maintainers of these projects had published their own Spring Boot 4 upgrade, the skill's result was compared with theirs. What it can't do for you: it can't guess compatible versions of your private/internal libraries (it asks), and very unusual setups may still need a human for a few errors. The skill stops and tells you instead of looping. Invoke it with /upgrade-spring-boot-4 or just ask your agent to "upgrade this project to Spring Boot 4". It changes nothing until it has checked the preconditions and you have said "continue". Licensing note: this skill uses the OpenRewrite rewrite-spring recipe. Your own build downloads the recipe under its own licence (Moderne Source Available License), and you run it on your own code. This skill contains no OpenRewrite or recipe code. Spring and Spring Boot are trademarks of Broadcom Inc. OpenRewrite is a trademark of Moderne, Inc. This skill is not affiliated with or endorsed by either.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scanned
Verified clean 13 days ago
- Passed all security checks, Safe to install