Maven多環境打包

<profiles>
        <profile>
            <id>dev</id>
            <properties>
                <profiles.active>dev</profiles.active>
            </properties>

        </profile>

        <profile>
            <id>beta</id>
            <properties>
                <profiles.active>beta</profiles.active>
            </properties>
        </profile>
        <profile>
            <id>prd</id>
            <properties>
                <profiles.active>prd</profiles.active>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
    </profiles>
<build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources/config</directory>
                <excludes>
                    <exclude>**/**</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources/config/${profiles.active}	   </directory>
            </resource>
        </resources>
</build>

.../resources/config/dev or beta or prdui

mvn clean install -P prdcode

相關文章
相關標籤/搜索