java - Spring Boot YAML 中 @something.value@ 和 ${something.value} 之间的区别
问题描述
我将 spring-doc 提供的演示中的代码示例称为properties和yaml,下面提供的代码示例。
springdoc.version= @springdoc.version@
springdoc.swagger-ui.use-root-path=true
springdoc:
version: '@springdoc.version@'
swagger-ui:
use-root-path: true
我想了解提及方式@springdoc.verison@
和${springdoc.version}
. 在 yaml 文件中使用它的标准是什么?
解决方案
您将在 application.yaml 或 application.properties 中使用 @..@ 来访问在 maven 的 pom.xml 文件中定义的值。
当您的项目是成绩项目时,您将使用 ${...}。
推荐阅读
- excel - 如何将超过一百万行的数据库加载到数据透视表缓存中?
- mysql - 如何在 MySQL 5.7.34 中具有 JSON 数据类型列的表中有条件地选择行?
- javascript - 基于现有过滤创建新数组
- swift - 如何管理 1 个应用程序的证书但有很多捆绑包 ID?
- usb - USB-PD 上的电池统计信息
- vba - MS.ACCESS - 大量打印的循环槽记录 - 未找到错误项目
- mysql - MariaDB 按键选择值的计数
- python - 在 python 中,为什么引发相同的异常比引发新的异常占用更多的内存?
- python - pypy 列表理解比嵌套列表慢
- python - 如何在 Pandas DataFrame 中切换列 MultiIndex 但在内部级别进行分组?