maven中多环境配置

2023-09-10

maven中配置多环境的写法

<!--    多环境配置-->
    <profiles>
<!--        开发环境-->
        <profile>
            <id>env_dep</id>
            <properties>
                <jdbc.url>jdbc:mysql://127.0.0.1:3306/db01?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false&amp;serverTimezone=GMT</jdbc.url>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
<!--        多环境-->
        <profile>
            <id>env_pro</id>
            <properties>
                <jdbc.url>jdbc:mysql://xxx:3306/db01?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false&amp;serverTimezone=GMT</jdbc.url>
            </properties>
        </profile>
<!--        测试环境-->
        <profile>
            <id>env_test</id>
            <properties>
                <jdbc.url>jdbc:mysql://xxx:3306/db01?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false&amp;serverTimezone=GMT</jdbc.url>
            </properties>
        </profile>
    </profiles>

 

posted @ 2023-09-10 12:04  努力是一种常态  阅读(51)  评论(0编辑  收藏  举报