Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

OpenRewrite

openrewrite.org

  • Free plan
  • Linux
  • Self-hosted
7.4 Club score Visit openrewrite.org

What OpenRewrite is

OpenRewrite is a free, open-source ecosystem for automated code refactoring and reducing technical debt. It applies recipes to code represented as Lossless Semantic Trees, then prints the modified trees back into source for review. Recipes address framework migrations, security fixes, and style consistency, and may be authored as YAML, Refaster templates, or Java. Maven and Gradle plugins run recipes locally as part of a build, one repository at a time. The Maven plugin has a dry-run goal that reports possible changes and writes diff files; recipes run only when explicitly activated by name. Documented language support includes Java, Kotlin, and Groovy, while data formats include HCL, JSON, Properties, Protobuf, TOML, XML, and YAML. Named framework support includes Spring, Quarkus, and Micronaut. The recipe index lists 4,183 recipes across modules. Core framework and language libraries use Apache License 2.0, but some recipes have source-available or proprietary licenses. Artifacts are distributed through an authenticated repository, and some recipes require a Moderne subscription.

Who it suits

OpenRewrite suits developers and teams maintaining codebases who want to apply repeatable migrations, security fixes, or style changes through build tools. It is most directly suited to work on one repository at a time.

Good to know, and what to watch

  • Maven and Gradle plugins run recipes locally.
  • Dry-run reports proposed changes and writes diff files.
  • Recipes require explicit activation by name.
  • Supports Java, Kotlin, and Groovy.
  • Free introductory course and community help are available.
  • Runs recipes against one repository at a time.
  • Artifact repository access requires authentication.
  • Some recipes require a Moderne subscription.
  • Some recipes use source-available or proprietary licenses.

OpenRewrite core

Free

Open source

The Club's review

OpenRewrite is an open-source system for applying automated refactoring recipes to code. It is best suited to teams maintaining Java, Kotlin, or Groovy repositories that want repeatable changes within Maven or Gradle workflows. Its core is free and review-oriented, but repository-by-repository execution and recipe access rules limit its reach.

Overview

OpenRewrite converts code into Lossless Semantic Trees, transforms those trees, then prints the updated code back to source. Recipes target work such as framework migrations, security fixes, and stylistic consistency. This makes recurring maintenance changes easier to apply systematically, while still leaving developers responsible for selecting and reviewing the results.

The project began with Java and is expanding its language and framework coverage. Its documentation covers Java, Kotlin, Groovy, and data formats including HCL, JSON, Properties, Protobuf, TOML, XML, and YAML. Named framework coverage includes Spring, Quarkus, and Micronaut. The recipe index spans 4,183 recipes across modules, but breadth is not a substitute for checking that a recipe matches a repository and its licensing needs.

Key features

  • Maven and Gradle plugins: Recipes run as part of a build, locally, without connecting to Moderne or OpenRewrite except to access configured artifact repositories. That suits teams wanting to keep execution in existing build workflows, though access to artifacts can still require authentication.
  • Dry-run review: The Maven plugin can report which recipes would change code and write diff files in module target folders. This gives teams a chance to inspect proposed edits before applying them; the plugin does not run any recipe until it is explicitly activated by name.
  • Recipe authoring: Recipes can be written as declarative YAML, Refaster templates, or imperative Java, offering different approaches for teams with different levels of programming effort.
  • IDE support: IntelliJ IDEA 2024.1 or later has built-in OpenRewrite support, and the recipe development guide recommends enabling the OpenRewrite IntelliJ plugin.
  • Learning and community: A free self-paced introductory course and help through Slack or Discord give new users ways to get oriented and ask questions.

Pricing

The OpenRewrite core plan costs nothing. It includes the core framework and Apache-licensed recipes, with batch refactoring and AST-based analysis, but runs against one repository at a time. That is a practical fit for teams modernizing repositories individually without paying for the core tooling.

The free core does not mean every recipe is unrestricted. Core framework and language libraries use Apache License 2.0, while some recipes carry source-available or proprietary terms. OpenRewrite artifacts are distributed through the Code Genome Project repository, which requires authentication; some source-available and proprietary recipes require a Moderne subscription. Source-available software may be used on a company's own code, but cannot be commercialized or offered to others as a managed service. Open-source projects can use Apache-licensed and Moderne Source Available recipes through the Maven and Gradle plugins or Moderne CLI without a license for those repositories.

Platforms

OpenRewrite supports Linux and self-hosted use. Maven and Gradle plugins run recipes on one repository at a time. For coordinated changes across multiple repositories, Moderne provides multi-repository execution and native GitHub, GitLab, and Bitbucket integrations for coordinated pull requests.

Who it's for

OpenRewrite is a strong choice for development teams that need repeatable code migrations or maintenance fixes and can run them within Maven or Gradle. The local workflow, dry-run diffs, and broad recipe catalog are especially useful when reviewers need visibility into changes before they land. It is less suited to organizations that need centralized fleet-wide execution from the core alone, or to users who need recipe licensing and access without authentication or subscription considerations.

Pros and cons

Pros

  • Review before applying: Maven dry runs produce diffs, reducing the risk of treating automated edits as unquestioned changes.
  • Useful breadth: Recipes cover migrations, security fixes, and style work across several languages, formats, and named frameworks.
  • Free Apache-licensed core: Teams can use the core framework and Apache-licensed recipes without a paid core plan.
  • Build-local execution: Maven and Gradle integration lets teams run recipes within familiar build processes without a service connection.

Cons

  • One repository at a time: The core does not coordinate large-scale multi-repository migrations; that requires Moderne.
  • Access friction: The artifact repository requires authentication, which adds a setup step before teams can use its artifacts.
  • Recipe licensing varies: Some recipes have source-available or proprietary terms, and some require a Moderne subscription, so teams must check individual recipe rights.

Alternatives

Explore the Code Refactoring Tools directory to compare options. ReSharper is worth considering for C# support in VS Code and compatible editors, with a free non-commercial plan and a paid plan priced at $389 per. Sourcery may suit teams looking for AI reviews, PR summaries, diagrams, one-click fixes, and custom review rules for public repositories on its free Open Source plan. ast-grep is another free option for readers comparing code-analysis tools. CodART may fit users seeking MIT-licensed software, though SciTools Understand requires a separate professional license. CodeRush offers its features and updates free for commercial use, with technical support requiring a paid subscription. Roslynator is a free alternative for readers considering developer tooling. Spoon is a free and open-source option for readers comparing code-analysis tools. Coccinelle is a free alternative for Linux and macOS users.

Verdict

Choose OpenRewrite if your team wants a free, build-integrated way to apply and review repeatable refactoring recipes one repository at a time. Its strongest case is the combination of local Maven or Gradle execution and reviewable dry-run diffs. Look elsewhere if your priority is orchestrating changes across many repositories from the core, or if recipe access and licensing constraints do not fit your organization.

The verdict

OpenRewrite offers recipe-based refactoring with local build-tool workflows and a dry-run option. Review repository access requirements and recipe licensing before adopting recipes beyond the Apache-licensed core.

What the maker publishes

Access limitation
OpenRewrite artifacts are distributed through the Code Genome Project repository, which requires authentication; some source-available and proprietary recipes require a Moderne subscription. source
Build integrations
The project provides Maven and Gradle plugins for running recipes on one repository at a time. source
Build tools
OpenRewrite provides Maven and Gradle plugins for running recipes as part of a build. source
Company
Moderne's press kit lists Miami, Florida as its headquarters and says OpenRewrite originated as a project Jonathan Schneider started at Netflix. source
Framework coverage
The documentation names Spring, Quarkus, and Micronaut among supported frameworks. source
How it works
It transforms Lossless Semantic Trees and prints the modified trees back into source code for review. source
How it works
Recipes modify Lossless Semantic Trees and print the modified trees back to source code while honoring original formatting. source
Integration
The recipe development guide says IntelliJ IDEA 2024.1 or later has built-in OpenRewrite support and recommends enabling the OpenRewrite IntelliJ plugin. source
Integrations
The Moderne platform page describes native GitHub, GitLab, and Bitbucket integrations for coordinated pull requests. source
Languages
The OpenRewrite project describes Java as its original focus and says language and framework coverage is expanding. source
Learning and support
The documentation points users to a free self-paced introductory course and offers community help through Slack or Discord. source
Licensing
The core framework and language libraries are Apache License 2.0, while some recipes use source-available or proprietary licenses. source
Licensing
The core framework is Apache licensed, while some recipe modules use the Moderne Source Available License or a proprietary license. source
Local execution
The Maven and Gradle plugins run locally without connecting to Moderne or OpenRewrite, aside from accessing configured artifact repositories. source
Open source usage
Open source projects can use Apache-licensed and Moderne Source Available recipes through the OpenRewrite Maven and Gradle plugins or Moderne CLI without a license for those repositories. source
Purpose
OpenRewrite is an open-source automated refactoring ecosystem for updating code and reducing technical debt. source
Purpose
OpenRewrite is an open-source automated refactoring ecosystem for eliminating technical debt in code repositories. source
Recipe activation
The Maven plugin runs no recipe unless it is explicitly activated by name. source
Recipe catalog
The recipe index lists 4,183 recipes across modules. source
Recipe formats
Recipes can be authored as declarative YAML, Refaster templates, or imperative Java. source
Recipes
Recipes automate framework migrations, security fixes, and stylistic consistency tasks. source
Recipe uses
Recipes support framework migrations, security fixes, and stylistic consistency tasks. source
Review before applying
The Maven plugin offers a dry-run goal that reports recipes that would make changes and writes diff files in module target folders. source
Scale limit
OpenRewrite by itself runs a recipe against one repository at a time; Moderne provides multi-repository execution. source

Checked against the maker's pages on 5 Oct 2026.