springCloud bootstarp.yml和application.yml初识

bootstarp.yml先于application.yml加载;(因此可在bootstarp.yml中配置application需要用到的数据)
boostarp.yml配置的是系统引导性配置;
如系统的版本及说明

application:
  version: 1.0.0 #版本号
  copyright:  #版权

如远程git配置

spring:
  profiles: dev #默认配置文件 application-dev.yml
  cloud:
    config:
      server:
        default-application-name:    #默认应用程序名
        git:
          uri: https://github.com/LSPGY/-.git #项目git地址
          search-paths: config-repo/{application},config-repo/common #路径匹配 后续学习中继续了解
          username: 
          password:

application.yml后加载,但优先级高于bootstrap.yml;可在application.yml中覆盖application配置(个人理解,真实性有待去实践确认)
bootstarp.yml具有非常低的优先级

这段摘自官网,其中but note that these do not contain any data from bootstrap.yml并不理解,有大佬看到可在评论区解释一下,谢谢
Because of the ordering rules of property sources the “bootstrap” entries take precedence, but note that these do not contain any data from bootstrap.yml, which has very low precedence, but can be used to set defaults
.

application.yml配置各种集成框架或组件的配置 如 mybatis、缓存、线程池、security、Robbie等;自定义数据配置 如设置密码最大错误次数、用户账号锁定时间等

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值