From 161cbed79181dc79d163a00b2b2ec53cb999d422 Mon Sep 17 00:00:00 2001 From: heibaiying <31504331+heibaiying@users.noreply.github.com> Date: Sun, 25 Aug 2019 17:46:40 +0800 Subject: [PATCH] Update README.md --- spring-boot/spring-boot-yml-profile/README.md | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/spring-boot/spring-boot-yml-profile/README.md b/spring-boot/spring-boot-yml-profile/README.md index 6663c3e..2f134ba 100644 --- a/spring-boot/spring-boot-yml-profile/README.md +++ b/spring-boot/spring-boot-yml-profile/README.md @@ -1,22 +1,24 @@ # Spring Boot YAML - - + + + ## 一、项目结构
+ ## 二、YAML 语法 Spring Boot 支持使用 Yaml 语法来书写配置文件,相比于 properties 文件键值对的配置格式,Yaml 语法的配置更加精简,层次也更加分明。其基本规则和语法如下: @@ -148,6 +150,7 @@ Spring Boot 在将环境属性绑定到 `@ConfigurationProperties` beans 时会 可以在同一个 yml 文件中包含多个配置文件,并使用 `---` 进行分割。或者遵循 application-xxx.yml 命名方式来为不同的环境(如开发环境,生产环境,测试环境)分别生成不同的配置文件,然后再在主配置文件 application.yml 中来决定使用哪个具体的配置,或在启动时候通过命令行参数来决定,命令行的优先级大于配置文件的优先级。
+ ```yaml # 配置文件中激活开发环境配置 spring: @@ -188,4 +191,4 @@ Spring Boot 支持在多个地方进行配置的定义,按照配置方式的 ```shell 命令行 > application-{profile}.yml > application.yml > 默认属性 -``` \ No newline at end of file +```