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")
activeRecipe("org.openrewrite.java.testing.junit5.JUnit5BestPractices")
activeRecipe("org.openrewrite.java.testing.junit5.JUnit5BestPractices")

Enter fullscreen mode Exit fullscreen mode

And run the gradle task:

gradlew rewriteRun
gradlew rewriteRun
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/

原文链接:Upgrading Java and Spring without hassle

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
I'm not lazy, I'm on energy saving mode.
我不懒,我只是开启了节能模式
评论 抢沙发

请登录后发表评论

    暂无评论内容