spring boot使用maven添加默认配置
有三个配置文件,分为:dev、test、prod,想要默认使用prod,pom.xml添加如下配置即可:
<profiles> <profile> <id>dev</id> <properties> <spring.active>dev</spring.active> </properties> </profile> <profile> <id>test</id> <properties> <spring.active>test</spring.active> </properties> </profile> <profile> <id>prod</id> <properties> <spring.active>prod</spring.active> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> </profiles>