Update projects to the latest Quarkus version

experimental

You can update or upgrade your Quarkus projects to the latest version of Quarkus by using an update command.

The update command primarily employs OpenRewrite recipes to automate updates for most project dependencies, source code, and documentation.

这项技术被认为是experimental。

在 experimental(实验) 模式下,要求早期反馈以使想法成熟。在解决方案成熟之前,不保证稳定性或长期存在于平台中。欢迎在我们的 邮件列表 中提供反馈,或在我们的 GitHub问题列表 中提出问题。

For a full list of possible statuses, check our FAQ entry.

The update command automates only a subset of the migration. Always review the Migration Guides for your target version to identify any additional steps that require manual changes.

Post-update, if expected updates are missing, consider the following reasons:

  • The recipe might not include a specific item in your project.

  • Your project might use an extension that is incompatible with the latest Quarkus version.

先决条件

要完成这个指南,你需要:

  • 大概30 minutes

  • 编辑器

  • JDK 17+ installed with JAVA_HOME configured appropriately

  • Apache Maven 3.9.16

  • 如果你愿意的话,还可以选择使用Quarkus CLI

  • 如果你想构建原生可执行程序,可以选择安装Mandrel或者GraalVM,并正确配置(或者使用Docker在容器中进行构建)

  • A project based on Quarkus version 2.13 or later.

Procedure

  1. Create a working branch for your project by using your version control system.

  2. To use the Quarkus CLI in the next step, install the latest version of the Quarkus CLI. Confirm the version number using quarkus -v.

  3. Go to the project directory and update the project to the latest stream:

    Using Quarkus CLI
    quarkus update

    Optional: To specify a particular stream, use the --stream option; for example: --stream=3.2

    Using Maven
    ./mvnw io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:update -N

    Optional: To specify a particular stream, use the -Dstream option; for example: -Dstream=3.2

  4. Analyze the update command output for potential instructions and perform the suggested tasks if necessary.

  5. Use a diff tool to inspect all changes.

  6. Review the Migration Guides for your target version and apply any additional steps not covered by the update command.

  7. Ensure the project builds without errors, all tests pass, and the application functions as required before deploying to production.

Update recipes

The OpenRewrite recipes used by the update command are maintained in the Quarkus Updates repository. If you find that a recipe is missing or incorrect, you can contribute improvements there. Refer to the README.md and the CONTRIBUTING.md guide for detailed instructions on how to write and test recipes.