From 8b107a5f4a220896fc78dcc755e48d436dea144f Mon Sep 17 00:00:00 2001 From: qibaoguang Date: Sun, 8 Feb 2015 22:12:45 +0800 Subject: [PATCH] Update 23.6.3. Multi-profile YAML documents.md --- .../23.6.3. Multi-profile YAML documents.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/IV. Spring Boot features/23.6.3. Multi-profile YAML documents.md b/IV. Spring Boot features/23.6.3. Multi-profile YAML documents.md index e69de29..2c283b7 100644 --- a/IV. Spring Boot features/23.6.3. Multi-profile YAML documents.md +++ b/IV. Spring Boot features/23.6.3. Multi-profile YAML documents.md @@ -0,0 +1,18 @@ +### 23.6.3. Multi-profile YAML文档 + +你可以在单个文件中定义多个特定配置(profile-specific)的YAML文档,并通过一个spring.profiles key标示应用的文档。例如: +```json +server: + address: 192.168.1.100 +--- +spring: + profiles: development +server: + address: 127.0.0.1 +--- +spring: + profiles: production +server: + address: 192.168.1.120 +``` +在上面的例子中,如果development配置被激活,那server.address属性将是127.0.0.1。如果development和production配置(profiles)没有启用,则该属性的值将是192.168.1.100。