- Mastering Spring Boot 2.0
- Dinesh Rajput
- 158字
- 2021-06-25 21:29:16
Multiple profiles inside a single YAML file
A YAML file can contain configuration for multiple profiles. You can define multiple profile-specific configurations in a single YAML file. Spring Boot provides a spring.profiles key to indicate when the document applies. Let's see the following example of how to define multiple profile-specific configurations in a single YAML file:
#Used for all profiles logging.level: org.springframework: INFO #'dev' profile only --- spring.profiles: dev database: host: localhost user: dev #'prod' profile only --- spring.profiles: prod database: host: 192.168.200.109 user: admin
In this application.yml file, we have defined database settings according to two profiles, dev and prod, by using a spring.profile key. In the file, '---' implies a separation between profiles.
Also, I've found that if you have both application.properties and application.yml side by side at the same level of precedence, properties in application.yml will override those in application.properties.
Let's see how to customize the error page in the Spring web application.
- 快·易·通:2天學會Office辦公應用(2016版)
- 和秋葉一起學:秒懂Excel
- Word Excel PPT 三合一 效率手冊:早做完,不加班
- 中文版AutoCAD 2016園林設計從入門到精通
- 精通Excel數據統計與分析
- Power BI企業級分析與應用
- LoadRunner性能測試巧匠訓練營
- Excel函數與公式應用技巧
- Flash CS6核心應用案例教程(全彩慕課版)
- PPT制作應用大全
- Office 2010辦公應用立體化教程(微課版)
- 極簡辦公:職場Word基礎課
- ChatGPT+Excel高效數據計算與處理(視頻教學版)
- 辦公軟件高級應用實驗指導
- iLike蘋果Office 2011 for Mac辦公應用