maven pom 动态设置jar包版本


1:“maven父节点”或“当前pom文件加上”以下profiles。(project节点下)

    <profiles>
        <profile>
            <id>devid>
            <activation>
                
                <activeByDefault>trueactiveByDefault>
            activation>

            <properties>
                <testVerSion>xxxxxDevtestVerSion>
                <vvv>xxxxxxxxxvvv>
            properties>

        profile>

        <profile>
            <id>testid>

            <properties>
                <testVerSion>xxxxxTesttestVerSion>
                <vvv>vvvvvv>
            properties>

        profile>

    profiles>

2:pom文件引入jar包(必须要有“默认环境”)


com.zxy.product
system-api
${testVerSion}


3:打包
mvn clean package -P test