springboot多环境配置文件
springboot多环境配置文件(dev,test,prod)
复制 配置文件application.properties多份,分别命名为
application-dev.properties (开发环境)
application-test.properties (测试环境)
application-prod.properties (生产环境)
在application.properties文件中通过配置spring.profiles.active属性来设置具体哪个配置文件生效,如下图:
spring.profiles.active=dev 表示 application-dev.properties 生效