Using OpenRewrite for migration automation
In this chapter, we made all migration upgrades manually. However, this approach can be too slow and error-prone in large code bases. Some tools try to automate this process, and the most popular one is OpenRewrite. OpenRewrite is a platform tool that aims to refactor any source code. According to its documentation, it aims to eliminate the technical debt of the developers’ repositories. It provides a mechanism to run recipes for source code refactoring. A popular open source recipe tackles the subject of this chapter: Spring Boot migrations.
Getting ready
We’ll use the original sample targeting Spring Boot 2.6.15 in this recipe. You can find it in the book’s GitHub repository at https://github.com/PacktPublishing/Spring-Boot-3.0-Cookbook in the chapter9/football
folder.
How to do it...
We’ll do the same upgrade from Spring 2.6 to Spring 3.2.4, automating most of the process. Seven recipes in one!
...