Skip to main content

Overview: Introduction to OpenRewrite

OpenRewrite is a framework for writing and running code transformations and recipes are the unit of work in OpenRewrite. This workshop is designed to help you understand how OpenRewrite works and gain hands-on experience running recipes using the Moderne CLI and the Moderne Platform.

Throughout the workshop, you’ll see screenshots and collapsible Reference output sections. Use them as quick sanity checks to confirm you’re on the right path. Don’t worry if your output differs slightly (for example, CLI versions, repository counts, and file paths can vary).

You will learn about fundamental concepts like the Lossless Semantic Tree (LST), data tables, visualizations, and DevCenter. This workshop is designed to be hands-on, so you can follow along with the examples in your own environment. The workshop consists of a series of modules that highlight key concepts, each with one or more exercises to help you practice what you've learned.

Be sure to also follow the links to the OpenRewrite documentation for more in-depth information. Feel free to skip around to the sections that interest you most, based on your needs and experience level.

If you get stuck or have questions, feel free to ask in the OpenRewrite Slack or Discord.

What you'll learn

  • Key concepts of OpenRewrite: LSTs, visitors, and recipes
  • How to set up and run recipes using the Moderne CLI
  • How to use the Moderne recipe builder to compose and customize declarative YAML recipes
  • What search markers, data tables, and visualizations and how to use them
  • How to use DevCenter to track migrations and upgrades

Prerequisites

To get the most out of this workshop, you should have:

  • Basic Java knowledge
  • A basic understanding of how to work with the command line/terminal

You will also need the following installed on your system:

  • JDK (Java 17 or higher recommended)

Workshop modules