Maven版本:更新未更新给定版本,它与仓库进行比较并更新为最新版本而不是给定版本

问题描述 投票:1回答:1

我想将我的补丁回补到我的旧版本jar中。我在nexus存储库中发布了1.0.85、1.0.86、1.0.87、1.0.88、1.0.89。我想更新我的修复程序,即回补丁版本1.0.85我将使用version:update-parent和我指定的新版本更新父pom版本1.0.85_b1。但是它会检查存储库并从nexus存储库更新最新版本。即1.0.89。它没有更新1.0.85_b1。

mvn -f pom.xml -DallowSnapshots=false -DgenerateBackupPoms=false -DnewVersion=1.0.85b1 -Dproperty=parentVersion versions:update-parent

行家日志

`

    --- versions-maven-plugin:2.7:update-parent (default-cli) @ componet ---
[INFO] artifact com.xxxx.yyy:zzzz-aaaa: checking for updates from xxxxx
[INFO] artifact com.xxxx.yyy:zzzz-aaaa: checking for updates from xxxxx
[INFO] artifact com.xxxx.yyy:zzzz-aaaa: checking for updates from xxxxx
[INFO] artifact com.xxxx.yyy:zzzz-aaaa: checking for updates from xxxxx
[INFO] artifact com.xxxx.yyy:zzzz-aaaa: checking for updates from xxxxx
[INFO] artifact com.xxxx.yyy:zzzz-aaaa: checking for updates from xxxxx
[INFO] artifact com.xxxx.yyy:zzzz-aaaa: checking for updates from xxxxx
Downloading from nexus-xxx-rep: http://maven.xxxgroup.com/content/groups/all/com/xxx/xxx/componet-parent/1.0.89/componet-parent-1.0.89.pom
Downloaded from nexus-xxx-rep: http://maven.xxxgroup.com/content/groups/all/com/xxx/xxx/componet-parent/1.0.89/componet-parent-1.0.89.pom (4.8 kB at 5.4 kB/s)
[INFO] Updating parent from 1.0.85 to 1.0.89
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] componet proj DEV.0.0-SNAPSHOT .................... SUCCESS [  3.211 s]
[INFO] componet 1.0.85 ...................................... SUCCESS [ 11.108 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.352 s
[INFO] Finished at: 2019-10-17T21:02:34+05:30

`

java maven nexus
1个回答
0
投票

您需要使用参数parentVersion。在这里,您可以为所需的版本设置上下限。

https://www.mojohaus.org/versions-maven-plugin/examples/update-parent.html

© www.soinside.com 2019 - 2024. All rights reserved.