# 5. 升级Spring Boot

[项目wiki](https://github.com/spring-projects/spring-boot/wiki)上提供了如何从早期版本的 Spring Boot 升级的说明。[按照发行说明](https://github.com/spring-projects/spring-boot/wiki#release-notes)部分中的链接查找您要升级到的版本。

升级说明始终是发行说明中的第一项。如果您落后了多个版本，请确保您还查看了所跳转版本的发行说明。

#### 5.1. 从 1.x 升级

如果您要从Spring Boot `1.x`版本升级，请查看[项目 wiki 上的“迁移指南”](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide)，其中提供了详细的升级说明。另请查看[“发行说明”，](https://github.com/spring-projects/spring-boot/wiki)了解每个版本的“新的和值得注意的”功能列表。

#### 5.2. 升级到新功能版本

升级到新功能版本时，某些属性可能已被重命名或删除。Spring Boot 提供了一种在启动时分析应用程序环境并打印诊断信息的方法，而且还可以在运行时为您临时迁移属性。要启用该功能，请将以下依赖项添加到您的项目中：

```
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-properties-migrator</artifactId>
    <scope>runtime</scope>
</dependency>
```

> 稍后添加到环境中的属性（例如使用`@PropertySource` 时）将不会被考虑在内。
>
> 完成迁移后，请确保从项目的依赖项中删除此模块。

#### 5.3. 升级 Spring Boot CLI

要升级现有的 CLI 安装，请使用适当的包管理器命令（例如，`brew upgrade`）。如果您手动安装了 CLI，请按照[标准说明](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#getting-started.installing.cli.manual-installation)进行操作，并记住更新环境变量`PATH`以删除任何旧的引用。

#### 5.4. 接下来读什么

一旦您决定升级您的应用程序，您可以在文档的其余部分找到有关特定功能的详细信息。

Spring Boot 的文档特定于该版本，因此您在此处找到的任何信息都将包含该版本中的最新更改。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.shiker.tech/spring-boot-can-kao-wen-dang/5.-sheng-ji-spring-boot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
