zoukankan      html  css  js  c++  java
  • maven项目版本管理

    当前项目有许多模块并且存在父子关系,如下:

        <parent>
            <groupId>com.boot</groupId>
            <artifactId>boot-facede</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </parent>
        <artifactId>boot-facede-flat</artifactId>
        <packaging>jar</packaging>


    执行以下命令,升级父项目以及所有子项目的版本:

    mvn versions:set -DnewVersion=2.0.0-SNAPSHOT


    得到以下结果

      <parent>
            <groupId>com.boot</groupId>
            <artifactId>boot-facede</artifactId>
            <version>2.0.0-SNAPSHOT</version>
        </parent>
        <artifactId>boot-facede-flat</artifactId>
        <packaging>jar</packaging>

    如果想回退:

    mvn versions:revert

    revert  rely on the 

    pom.xml.versionsBackup


    接下来修改所有被依赖的版本:

    mvn versions:update-child-modules

    或者

    mvn ‐N versions:update‐child‐modules

    确认变更 

    mvn versions:commit

     查看更新组件

    mvn versions:display-plugin-updates


    当项目开发到一定阶段要切换为正式版本时,则执行以下命令:

    mvn release:prepare
     <parent>
            <groupId>com.boot</groupId>
            <artifactId>boot-facede</artifactId>
            <version>2.0.0-RELEASE</version>
        </parent>
        <artifactId>boot-facede-flat</artifactId>
        <packaging>jar</packaging>


    要发布正式版本时则执行以下命令:

    mvn release:perform


    更多详细官方文档:http://www.mojohaus.org/versions-maven-plugin/usage.html

    http://www.mojohaus.org/versions-maven-plugin/examples/set.html

    正因为当初对未来做了太多的憧憬,所以对现在的自己尤其失望。生命中曾经有过的所有灿烂,终究都需要用寂寞来偿还。
  • 相关阅读:
    ZOJ Problem Set–2781 Rounders
    ZOJ Problem Set 3418 Binary Number
    ZOJ Problem Set 1090 The Circumference of the Circle
    ZOJ Problem Set 2932 The Seven Percent Solution
    java的反射应用
    C++指针之数据成员指针
    为了实现相同账号不能重复登录功能做的努力
    我对设计模式的理解
    ZOJ Problem Set – 1045 HangOver
    好久不见
  • 原文地址:https://www.cnblogs.com/candlia/p/11919943.html
Copyright © 2011-2022 走看看