What it does
OpenRewrite is an automated refactoring framework built around recipes that inspect and transform source code. Its quickstart adds the framework to a Maven or Gradle project, selects a recipe, runs it, and reviews the resulting diff. This makes it useful for repeatable dependency or source migrations; the framework license is Apache, while recipe modules can carry different licensing and access terms.
Run a recipe against a sample project
The official quickstart uses a Maven or Gradle project, configures an OpenRewrite plugin and recipe, then runs mvn rewrite:run or gradle rewriteRun. The recipe changes files, after which the guide recommends reviewing the diff before committing or adding more recipes. These are documented commands, not commands executed for this listing. A first task might standardize import ordering or apply one migration recipe to a small module before expanding the change across a repository.
OpenRewrite is most useful when the transformation can be expressed as a repeatable recipe rather than a hand-edited one-off. The official licensing guide says the core framework is Apache licensed, but recipe modules are not all under the same terms: some community recipes are Apache, while others may be source-available or commercial. The docs also announce that recipes are moving from Maven Central to the Code Genome Project and ask users to configure access, so confirm repository availability and the license for the specific recipe before adopting it in CI or redistribution.
Strengths
- Recipes provide repeatable transformations that can be applied to project source and reviewed as a diff.
- The official quickstart covers both Maven and Gradle workflows.
- The core framework has an Apache license, with official documentation describing recipe-specific licensing.
Watch out for
- Applying a recipe modifies project files, so review the diff and run the project's own tests before accepting changes.
- Recipe licensing and artifact access vary; some recipes are not under the framework's Apache license.
- The docs announce a move of recipes to the Code Genome Project, so dependency resolution may require current repository access configuration.
Best for
- Teams applying consistent source or dependency migrations across multiple projects.
- Java projects using Maven or Gradle that can review automated changes before merging.
- Maintainers who need repeatable refactoring recipes and can verify recipe-level license terms.
Sources
- OpenRewrite Documentation (Oct 25, 2026)
- Quickstart: Setting Up Your Project and Running Recipes (Oct 25, 2026)
- OpenRewrite Licensing (Oct 25, 2026)
- openrewrite/rewrite source repository (Oct 25, 2026)
- Apache License 2.0 | OpenRewrite Core (Oct 25, 2026)
