springboot-多个yml文件的配置

yml文件配置

yaml与properties配置文件除了展示形式不相同以外,其它功能和作用都是一样的;在项目中读取的方式相同。

书写格式:

  1. 树状层级结构展示配置项;
  2. 配置项之间如果有关系的话需要分行空两格;
  3. 配置项如果有值的话,那么需要在 :之后空一格再写配置项值;
jdbc:
  driverClassName: com.mysql.jdbc.Driver
  url: jdbc:mysql://127.0.0.1:3306/heima
  username: root
  password: root

多个yml文件配置

多个yml

你可能感兴趣的:(spring,boot)