Update 23.6.3. Multi-profile YAML documents.md

master
qibaoguang 2015-02-08 22:12:45 +08:00
parent ae37aadbd3
commit 8b107a5f4a
1 changed files with 18 additions and 0 deletions

View File

@ -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。