SpringCloud 多环境配置文件使用
2020-10-30 本文已影响0人
莫夏_b560
多个bootstrap.yml配置文件 bootstrap-dev.yml bootstrap-prod.yml bootstrap-local.yml 想使用local的配置 如果是IDEA启动也在页面配置Active profiles指定为local 如果是jar包命令启动java -jar 名称.jar --spring.profiles.active=test 如果是测试类启动需在启动类上增加注解@ActiveProfiles("local")