已弃用的应用属性
原文:https://docs.spring.io/spring-boot/appendix/deprecated-application-properties/index.html (Spring Boot 4.2.0)
以下已弃用的属性可以在 application.properties、application.yaml 中指定,或作为命令行开关。对这些属性的支持将在未来版本中移除,应尽快迁移。
Spring Boot 提供了一个有用的 spring-boot-properties-migrator 工具来帮助迁移已弃用的属性。要使用该迁移工具,请将以下依赖添加到项目:
Maven:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-properties-migrator</artifactId> <scope>runtime</scope> </dependency>
Gradle:
runtimeOnly("org.springframework.boot:spring-boot-properties-migrator")
添加依赖后,该工具不仅会分析应用环境并打印诊断信息,还会在运行时临时迁移属性。迁移完成后,请务必从项目中移除该模块。
本附录列出所有已弃用的属性、替代属性及弃用原因。