Spring Boot bootstrap.yml外置

有时候我们是需要将bootstrap.yml文件的外置的,也即是说,在spring boot应用启动后,不直接使用jar包里面的bootstrap.yml文件,而是读取某个目录下的bootstrap.yml文件,然后进行覆盖。注意在spring boot 2.0之前的版本,得使用如下参数:

spring.config.location

完整配置如下:

nohup java $JAVA_OPTS -jar xxxx.jar --spring.config.location=/data/sc_config/bootstrap.yml
  •  

而如果是spring boot 2.0以及以后的版本,可以使用:

spring.cloud.bootstrap.location

完整配置如下:

nohup java $JAVA_OPTS -jar xxxx.jar --spring.cloud.bootstrap.location=/data/sc_config/bootstrap.yml

转:https://samlin.blog.youkuaiyun.com/article/details/84993169?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值