第一种情况:
spring.profiles.active=环境变量
配置两个环境的,可根据实际需要增加环境模式(开发环境dev,测试环境test,回归坏境retu,预生产环境pre,生产环境prod,等等)
dev代表开发环境:
prod代表生产环境
pom.xml里面配置profiles:
<profiles>
<profile>
<id>dev</id>
<activation>
<!-- 默认激活-->
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<spring.profiles.active>dev&