- 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.
- Excel 2019公式與函數(shù)應(yīng)用大全(視頻教學(xué)版)
- Excel高效辦公:會計(jì)與財(cái)務(wù)管理(AI版)
- Excel 2010在會計(jì)與財(cái)務(wù)管理日常工作中的應(yīng)用
- Excel 2010使用詳解
- 漫!動作!人體動態(tài)漫畫素描技法超級大全
- Office 2016入門與提高
- Excel 2016高效辦公實(shí)戰(zhàn)應(yīng)用與技巧大全666招
- MATLAB技術(shù)大全
- 精通Excel數(shù)據(jù)統(tǒng)計(jì)與分析
- 辦公自動化教程(第2版)
- Word/Excel/PPT現(xiàn)代商務(wù)辦公從新手到高手一本通
- Access數(shù)據(jù)庫程序設(shè)計(jì)實(shí)踐教程
- 新編Word/Excel/PPT 2003從入門到精通
- 快·易·通:2天學(xué)會Excel表格與數(shù)據(jù)處理(2016版)
- 辦公軟件高級應(yīng)用