Update projects to the latest Quarkus version
你可以使用更新命令将 {project-name} 项目更新或升级到 {project-name} 的最新版本。
You can update or upgrade your {project-name} projects to the latest version of {project-name} by using an update command.
更新命令主要使用 OpenRewrite 配方自动化更新大多数项目依赖项、源代码和文档。虽然这些配方会更新许多迁移项,但不会涵盖 {quarkus-migration-guide} 中详述的所有项。
The update command primarily employs OpenRewrite recipes to automate updates for most project dependencies, source code, and documentation. Although these recipes update many migration items, they do not cover all the items detailed in the {quarkus-migration-guide}.
在更新后,如果缺少预期的更新,请考虑以下原因:
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 {project-name} version.
对于使用 Hibernate ORM 或 Hibernate Reactive 的项目,请查看 Hibernate ORM 5 to 6 migration 快速参考。以下更新命令仅涵盖本指南的一小部分内容。
For projects that use Hibernate ORM or Hibernate Reactive, review the Hibernate ORM 5 to 6 migration quick reference. The following update command covers only a subset of this guide.
Prerequisites
include::{includes}/prerequisites.adoc[]* 基于 {project-name} 版本 2.13 或更高版本的项目。
Unresolved directive in update-quarkus.adoc - include::{includes}/prerequisites.adoc[] * A project based on {project-name} version 2.13 or later.
Procedure
-
Create a working branch for your project by using your version control system.
-
To use the Quarkus CLI in the next step, install the latest version of the Quarkus CLI. Confirm the version number using
quarkus -v
. -
Go to the project directory and update the project to the latest stream:[role="primary asciidoc-tabs-sync-cli"] .Using Quarkus CLI
quarkus update
可选:要指定特定的流,请使用 --stream
选项;例如: --stream=3.2
Optional: To specify a particular stream, use the --stream
option; for example: --stream=3.2
./mvnw {quarkus-platform-groupid}:quarkus-maven-plugin:{quarkus-version}:update -N
可选:要指定特定的流,请使用 -Dstream
选项;例如: -Dstream=3.2
Optional: To specify a particular stream, use the -Dstream
option; for example: -Dstream=3.2
. Analyze the update command output for potential instructions and perform the suggested tasks if necessary.
. Use a diff tool to inspect all changes.
. Review the {quarkus-migration-guide} for items that were not updated by the update command.
If your project has such items, implement the additional steps advised in these topics.
. Ensure the project builds without errors, all tests pass, and the application functions as required before deploying to production.