#1、resources文件夹下创建一个application.yml文件

springboot 添加多个配置文件_spring

#2、同时在目录下创建application-dev.yml、application-test.yml文件

springboot 添加多个配置文件_配置文件_02

#3、在application.ym文件中配置需要激活的配置文件

spring:
  profiles:
    active: test

如图所示我们要激活的是application-test.yml配置文件内容。