DEV Community

Ayman Patel
Ayman Patel

Posted on

Upgrading Java and Spring without hassle

๐Ÿค” Want to upgrade Java, Spring Boot versions is a methodical way

There is a platform for that!

๐Ÿ’ก Moderne's OpenRewrite platform helps with managing complexities in upgrading your Java based projects

Some common use cases include:

  1. Upgrading to Java 17
  2. Upgrading Spring Boot 2 to Spring Boot 3

๐Ÿ™‹Why a tool?

Knowing the API changes in libraries for every dependency is difficult. Also, a lot of time can be wasted in a particular solution that does not work well with a particular dependency.

๐Ÿ”งHow does it work?

You can import custom recipes as Maven/Gradle task and run them.

For example, you want to migrate from JUnit 4 to JUnit 5, you can import a recipe for it in Gradle like this:

activeRecipe("org.openrewrite.java.testing.junit5.JUnit5BestPractices")
Enter fullscreen mode Exit fullscreen mode

And run the gradle task:

gradlew rewriteRun
Enter fullscreen mode Exit fullscreen mode

Since these recipes are chainable, you can add steps to make code changes incrementally.

Other features include:

  1. Writing your own custom recipes for your use-case
  2. Dashboard to track the recipes done in your project to track your level of completion of version migration.

๐Ÿ“– Resources:

  1. Moderne's site: https://www.moderne.io
  2. OpenRewrite recipes: https://docs.openrewrite.org/

Top comments (0)