OpenRewrite
OpenRewrite recipes for Java 21 and Spring Boot 3.
Deterministic rewrites for the mechanical part of an upgrade. The same result on every run, reviewed by an engineer.
The short answer
OpenRewrite is an open-source tool that rewrites Java source code using recipes: deterministic, repeatable transformations for upgrades such as Java 21 and Spring Boot 3. A recipe gives the same result on every run, which free-form AI output cannot promise. Ace8 runs recipes, tests the result and has an engineer review the diff.
Mechanics
How recipes work
OpenRewrite parses source code into a tree that keeps formatting and comments, applies a recipe to that tree, and writes the result back. A recipe is a set of small, rule-based changes. Recipes can be combined, so one composite recipe can carry a whole upgrade.
Because the rules are explicit, a recipe run is reproducible. Run it twice and you get the same diff. That makes it easy to audit and easy to run across many repositories.
OpenRewrite is built into Maven and Gradle as a plugin. A run produces a patch, which you review like any other change.
Java 21
Recipes we run for Java 21
The Java migration recipes handle removed and deprecated APIs, updated build settings and common library bumps. Confirm names against the current catalogue before use, since they change between releases. The Java 21 upgrade recipe is typically org.openrewrite.java.migrate.UpgradeToJava21.
Recipes do not change your CI image, your container base image or your runtime flags. Those are separate edits. See Java upgrade for the breaking changes recipes cannot see.
Spring Boot 3 and Jakarta
Recipes for Spring Boot 3 and Jakarta
Spring Boot 3 requires Java 17 or later and the Jakarta EE namespace. Two recipe families do most of the mechanical work: the Spring Boot 3 upgrade (for example org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0) and the javax to jakarta migration (org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta).
The first changes dependencies, properties and deprecated Spring calls. The second rewrites imports, descriptors and annotations. Confirm names against the current catalogue before use. For the full checklist, see Spring Boot 3 migration.
Evidence
Run log from our sample repo
We are running these recipes on an open-source Java 8, Spring Boot 2 and javax application. The log will list each recipe, the files it changed, the size of the diff, compile errors that remained and the test outcome, including the runs that failed. It is not published yet, so we do not state results here.
| Field in the run log | Why it is recorded |
|---|---|
| Recipe name and version | So the run can be repeated |
| Files changed and lines changed | To size the review |
| Compile errors after the run | To show what recipes leave undone |
| Tests before and after | To prove behavior held, or show where it did not |
| Manual fixes and review minutes | To show the real effort |
Limits
What recipes leave undone
- Behavior that depends on configuration outside the source code.
- Libraries that have no recipe, or whose recipe stops short.
- Design changes, such as moving from EJB to Spring beans where the semantics differ.
- Security configuration changes in frameworks that rewrote their model.
- Tests that fail for reasons unrelated to the rewrite.
Extending
Writing a custom recipe
When the same internal pattern appears hundreds of times, a custom recipe is cheaper than hundreds of manual edits. Typical cases are a proprietary logging wrapper, an in-house client library or a homegrown annotation. We write the recipe, test it on a sample, and run it across the estate.
Together
How this fits with AI-assisted tools
Run recipes first, because they are deterministic and cheap to check. Use an AI-assisted tool such as AWS Transform for what the recipes leave behind. Then test, then review. That order keeps the least predictable step as small as possible.
It is an open-source tool that rewrites Java source code using recipes, which are deterministic, repeatable transformations. It is used for upgrades such as Java 21 and Spring Boot 3.
No. Recipes are rule-based. That is the advantage: the same input gives the same output. We combine them with AI-assisted tools for cases recipes do not cover.
Yes. Recipes handle the mechanical edits. Configuration, security and behavior changes need review, and tests must pass.
The Spring Boot 3 upgrade recipe, often combined with the javax to jakarta migration. Confirm the exact names in the current catalogue before using them.
Yes. When a pattern repeats across the estate, a custom recipe is the cheaper route.
Know the cost before anything moves.
A fixed-price assessment gives you the inventory, the risk score and a phased plan. Scope and cost are fixed before the migration starts.
Book a Fixed-Price AssessmentGet in touch
Talk to a modernization engineer
Tell us what you run today. An engineer, not a sales script, replies within one business day.