
Discover how OpenRewrite, an open source Java-based auto refactoring engine with recipe-driven changes, enables repo-wide refactorings across frameworks, security fixes, and new language features.
Explore how Open Rewrite reads source code, builds a syntax tree, and uses recipes with a visitor to refactor a method into a personal greeting.
Identify the minimal system requirements for OpenRewrite, including a recent Java runtime and a build tool such as Maven or Gradle.
Explore OpenRewrite with a Java Spring Boot showcase repo on GitHub to reproduce refactoring concepts, clone the project, and auto migrate Spring Boot to a newer version.
Explore how OpenRewrite plugin enables automatic refactorings in a maven project by applying recipes like the Java Order Import recipe, demonstrating code changes, warnings, and streamlined refactoring workflows.
Explore lossless semantic trees (LSTs) and how open rewrite builds a type-aware, abstract syntax tree to enable precise, formatting-preserving refactorings via a powerful search API.
Explore recipes in OpenRewrite, defining exact refactorings on a lossless semantic tree. Learn how recipes traverse, modify imports, nest actions, and manage the LST lifecycle from read to write.
Compare OpenRewrite and Modern platform for large code bases, focusing on in-memory versus disk-based LST handling and when to use the paid option.
Explore how open rewrite implements the visitor pattern to traverse typed LSTs with a depth-first approach, using cursors and isomorphic versus non-isomorphic visitors.
Explore how styles govern the visual output of code in OpenRewrite, including indentation, line breaks, and import usage, and learn to activate named styles via the project descriptor.
Activate and run OpenRewrite recipes using the Active Recipes Configuration in your Maven or Gradle plugin, shortening fully qualified type references and improving imports in the visit class.
Run open rewrite recipes on your code base without altering the build using the maven plugin's run goal and system properties to specify a comma-separated recipe list.
Explore running OpenRewrite recipes without forking the Maven build, using run, dry run, and run no fork goals to speed up refactorings while printing or applying changes.
Explore available openrewrite recipes through the maven plugin's discover goal, enabling verbose reports on the classpath, IDE integration, and a recipe catalog on openrewrite.org organized by Java and other languages.
Configure open rewrite recipes with rewrite YAML to rename packages, control recursion, and run new or customized recipes via the Maven plugin.
Apply OpenRewrite styles to control code formatting in your build pipeline, using Google Java format and import ordering rules to automatically format and write the LST to disk.
Learn to add new recipe sources to OpenRewrite, use the Maven plugin for Spring Boot migrations, and manage recipe dependencies and trees for automated refactoring.
Learn to compose declarative OpenRewrite recipes in YAML by combining existing recipes, upgrade versions, rename packages, format code, and order imports, creating reusable automation for complex refactorings.
Master text based recipes in open rewrite that work on plain text files when no LST is created, using rewrite YAML, regex, and IntelliJ autocompletion.
Integrate OpenRewrite into your build pipeline to enable automatic refactoring during builds, processing sources in isolation and committing changes to version control after validation.
Explore the three types of recipes in OpenRewrite: declarative yaml recipes, refactor templates, and imperative recipes via the OpenRewrite API, including interfacing with the LST for flexibility.
Define declarative recipes in yaml as compositions of existing recipes and store them under source/main/resources/meta-inf rewrite, then use the modern recipe builder to assemble and deploy.
Explore how to prepare refaster templates for OpenRewrite by configuring dependencies, enabling parameter name recording, and using annotation processors to generate type-safe refactor recipes from templates.
Explore creating refaster-template recipes with open rewrite, using before and after templates to perform type-safe, search-and-replace refactorings such as list access and is empty, and generate recipe implementations.
Create an imperative recipe in OpenRewrite by extending recipe and implementing getDisplayName and getDescription, then prepare a visitor. Install with Maven and run the discover goal to list active recipes.
Create a Java visitor to visit LST nodes in open rewrite, overriding class and method declarations, using execution context and super calls, and print class and method names to logs.
Learn how to test imperative OpenRewrite recipes using a dedicated rewrite test interface, JUnit, and assertions to verify before-and-after source changes, ensuring recipes perform exactly as intended.
Discover how OpenRewrite uses cursors to navigate the Java LST, access parent nodes, and traverse to enclosing declarations for safe refactoring.
Explore how the OpenRewrite visitor enables data sharing between wizards to refactor a method into a personal greeting, using cursors and messages to pass context.
Apply open rewrite to modify a method declaration by adding a string name parameter, using a Java template and the with name method, and understand multi-cycle stabilization and cursor coordinates.
Learn how to implement non-isomorphic visitors in OpenRewrite to replace literals with method invocations, including adding final modifiers and managing cursor-aware templates.
Learn to add configurable options to OpenRewrite recipes, annotate them, and supply defaults and validations, with the spring Petclinic example guiding practical use.
Learn to use multiple visitors in one OpenRewrite recipe to perform complex refactorings, such as deleting unused private methods by detecting method usage through coordinated visitors.
Learn how OpenRewrite validates recipe configurations before execution, enforce mandatory options with the required attribute, and implement custom validations to prevent invalid method configurations from running.
Adopt best practices for OpenRewrite recipes: prefer declarative designs, make only necessary changes, ensure idempotent and immutable recipes, and perform changes in a single cycle.
Examine a case study on migrating to Lombok with OpenRewrite, applying recipes to replace getters and setters with Lombok annotations, and handling boolean getters with is.
Explore how to get further help with OpenRewrite through the Discord and Slack communities, OpenRewrite's homepage and openlibrary.org links, and additional topics, plus recommendations for related courses.
Unlock the power of automated code transformation with my beginner-friendly course on OpenRewrite! Whether you're a seasoned developer or just starting your coding journey, this course is designed to equip you with the basic skills and knowledge to leverage OpenRewrite for efficient code refactoring and modernization.
What You Will Learn:
Introduction to OpenRewrite: Understand what OpenRewrite is and how it revolutionizes the way we approach code changes.
Setting Up Your Environment: Step-by-step guidance on installing and configuring OpenRewrite in your development environment.
Creating Your First Recipe: Learn how to write custom recipes that automate complex code transformations, saving you time and reducing errors.
Who This Course Is For:
Software developers looking to enhance their refactoring skills
Anyone interested in modernizing legacy codebases
Why Choose This Course?
This course offers a unique blend of theory and practice. Join a community of learners who are transforming their coding practices with OpenRewrite. By the end of this course, you'll have understood all the basics you need to use OpenRewrite in your projects and write your very own first recipes.
Enroll Now!
Don’t miss out on the opportunity to elevate your coding skills. Enroll today and start mastering OpenRewrite—your future self will thank you!