【问题标题】:maven versions plugin does not fetch releases with build numbermaven 版本插件不获取带有内部版本号的版本
【发布时间】:2017-05-05 21:26:29
【问题描述】:

我有一个版本为 1.0.0-19 的库(19 是 Jenkins 内部版本号),在下一个 jenkins 版本中,版本 1.0.0-20 将分配给该库,并且该工件将部署到一个 maven 存储库.如果我执行versions:use-latest-versions,另一个在pom依赖部分引用库的工件不会获得最后一个版本,依赖版本仍然是1.0.0-19而不是1.0.0-20。可能跟allow*系统参数有关,版本号部分没有属性。

任何想法如何实现始终获得最后一个版本 (1.0.0-19 -> 1.0.0-20)?

【问题讨论】:

  • 您使用的是什么 IDe?你有什么配置想和我们分享吗? (允许*系统参数和co.)
  • @LeftyGBalogh 我使用这个 maven 参数:-e versions:update-parent versions:use-latest-versions -Dincludes=<compay package name>:* -DallowMajorUpdates=true -DallowMinorUpdates=true -DallowIncrementalUpdates=true -DallowSnapshots=true
  • 你能解决这个问题吗?

标签: maven version-control versioning maven-versions-plugin


【解决方案1】:

在您的 pom 中确保您正在使用 -

<dependencies>
    <dependency>
        <groupId>some.artifactory.group</groupId>
        <artifactId>artifact-name</artifactId>
        <version>1.0.0-19</version>
    </dependency>
</dependencies>
<!-- please use the appropriate artifact and groupId -->


<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.3</version>
        </plugin>
    </plugins>
</build>

你正在执行命令 -

mvn versions:use-latest-releases    

来源 - http://www.mojohaus.org/versions-maven-plugin/use-latest-releases-mojo.html

注意 - 万一这也涉及到 SNAPSHOTS,请注意 allowSnapshots 并将命令用作 -

mvn versions:use-latest-releases -DallowSnapshots=true

【讨论】:

  • 如果内部版本号发生变化,它不会更新任何内容,这也是我认为的 OP 的重点,也是我的问题。 IE。如果版本从 1.0.0-xx 更改为 1.0.1-yy 版本插件将更新它。但没有注意到 1.0.0-x 到 1.0.0-y。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-07-16
  • 2011-10-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-03-28
相关资源
最近更新 更多