Bee从V1.11开始,配置文件支持多环境差异化配置。
#since V1.11
#1.base main and Override with active, 2.rebase to active(other file)
#1 : main file + other file; 2 : just active file(other file); if do not set , will use mail file.
#bee.profiles.type=0
#命名规则 name rule: bee-{active}.properties
#bee.profiles.active = test
1、 比如所有的配置,开发环境,生产环境,除了数据库连接信息,其它的都相同。
在bee.properties中,配置:
bee.profiles.type=1
#命名规则 name rule: bee-{active}.properties
bee.profiles.active = prod
以上配置,表示以bee.properties为主,不一样的信息可以放在 bee-prod.properties中。
2、在bee.properties中,配置:
bee.profiles.type=2
#命名规则 name rule: bee-{active}.properties
bee.profiles.active = test
则表示,会使用bee-test.properties的配置信息,而bee.properties则不再使用。
另外,Bee支持设置bee.properties所在的文件夹位置。
实例中bee.properties放在:D:\temp中。

本文介绍了Bee从V1.11版本开始支持的多环境配置文件差异化,包括basemain和override功能,以及如何通过active属性切换不同环境配置。此外,还讲解了如何设置默认配置文件和使用特定路径的bee.properties。
最低0.47元/天 解锁文章
1123

被折叠的 条评论
为什么被折叠?



