zoukankan      html  css  js  c++  java
  • maven pom 动态设置jar包版本

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

        <profiles>
            <profile>
                <id>dev</id><!--开发环境(默认)-->
                <activation>
                    <!--默认环境-->
                    <activeByDefault>true</activeByDefault>
                </activation>
    
                <properties>
                    <testVerSion>xxxxxDev</testVerSion><!--动态参数标签-->
                    <vvv>xxxxxxxxx</vvv>
                </properties>
    
            </profile>
    
            <profile>
            
    <id>test</id><!--测试环境--> <properties> <testVerSion>xxxxxTest</testVerSion><!--动态参数标签--> <vvv>vvv</vvv> </properties> </profile> </profiles>

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

    <dependency>
    <groupId>com.zxy.product</groupId>
    <artifactId>system-api</artifactId>
    <version>${testVerSion}</version> <!--动态参数读取-->
    </dependency>

    3:打包传递环境值(测试环境 )
    mvn clean package -P test

  • 相关阅读:
    KafKa 发消息到Storm
    HBase的优化
    HBase部署与使用
    Scala 类
    Scala高阶函数
    模式匹配
    Scala数据结构
    scala基础语法
    Scala安装配置
    Kafka工作流程分析
  • 原文地址:https://www.cnblogs.com/wulm/p/15651358.html
Copyright © 2011-2022 走看看