Skip to main content

Overview: Fundamentals of recipe development workshop

This workshop is designed to help you build the skills needed to discover, run, customize, and build OpenRewrite recipes. OpenRewrite is a framework for writing and running code transformations. Recipes are the unit of work in OpenRewrite, and can be written in YAML, Refaster, or imperative Java.

Throughout this workshop, you'll explore all three approaches to writing recipes, as well as how to test and validate recipe behavior so you can gain confidence developing recipes that apply safe, scalable changes across your codebase. 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

  • How to run existing OpenRewrite recipes using the Moderne platform and CLI
  • Using the Moderne recipe builder to explore and preview transformations
  • Creating your own declarative YAML recipes
  • Scoping recipes using preconditions
  • Testing and validating recipe logic
  • Using Refaster for pattern-based Java transformations
  • How to write and run imperative Java-based recipes

Prerequisites

To get the most out of this workshop, you should at least be familiar with:

  • Writing Java code
  • Using build tools like Maven or Gradle