【问题标题】:Difference between @something.value@ and ${something.value} in spring boot YAMLspring boot YAML 中@something.value@ 和 ${something.value} 之间的区别
【发布时间】:2021-06-02 23:49:00
【问题描述】:

我指的是spring-doc提供的demo中的代码示例propertiesyaml,下面提供的代码示例。


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 文件中使用它的标准是什么?

【问题讨论】:

    标签: java spring-boot yaml


    【解决方案1】:

    在此处查看文档:https://docs.spring.io/spring-boot/docs/1.4.x/reference/html/howto-properties-and-configuration.html

    您将在 application.yaml 或 application.properties 中使用 @..@ 来访问在 maven 的 pom.xml 文件中定义的值。

    当您的项目是成绩项目时,您将使用 ${...}。

    【讨论】:

      猜你喜欢
      • 2015-12-31
      • 1970-01-01
      • 1970-01-01
      • 2020-07-02
      • 2018-03-24
      • 2017-02-19
      • 2015-07-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多