springboot 分离环境部署

application.yml 配合 pom.xml

spring:
profiles:
active: @spring.profiles.active@

pom.xml 文件

src/main/resources true org.apache.maven.plugins maven-resources-plugin 2.7 @ false prod prod true dev dev
    </profile>
    <profile>
        <!-- 测试环境 -->
        <id>test</id>
        <properties>
            <spring.profiles.active>test</spring.profiles.active>
        </properties>
    </profile>
</profiles>

分环境打包
mvn clean package -Pprod -Dmaven.test.skip=true

mvn clean package -Pdev -Dmaven.test.skip=true

如果有来生,一个人去远行,看不同的风景,感受生命的活力。。。
原文地址:https://www.cnblogs.com/Frank99/p/14622674.html