maven - Versions Maven Plugin update-parent 检查在线 maven
问题描述
我有 2 个 maven 项目,父母和孩子,都有 0.0.1-SNAPSHOT。
父母的pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tmn</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>parent</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
孩子的pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tmn</groupId>
<artifactId>child</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>com.tmn</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<name>child</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
我将父 pom 的版本更新为某个发布版本,比如 1.0.0 并mvn clean install
在我的父级上做了。所以,我的 maven 本地 repo 包含已发布的 pom。现在,我想更新 parent.version 和我的孩子 pom 的版本。我跑
mvn versions:update-parent -DparentVersion=1.0.0 -DgenerateBackupPoms=false -Dmaven.repo.local=/path/to/repo
我希望它盲目地将 parent.version 更新为我在命令中提供的 parentversion。但是我收到了这个警告并且它没有更新。
artifact com.tmn:parent: checking for updates
[WARNING] Not updating version: could not resolve any versions
这里记录了一个类似的问题,但我不明白这个问题的解决方案:https ://github.com/mojohaus/versions-maven-plugin/issues/121
解决方案
推荐阅读
- python - 如何替换不在当前循环Python中的文本文件中的一行
- ios - 在 iOS 14.5 中添加“apple-mobile-web-app-capable”元标记的移动网络应用程序不显示全屏帖子
- mongodb - 在辅助节点中查找“commitIndexBuild”操作日志条目
- html - 如果被禁用
- c# - C# - 使用 Refit 的 Web Api 传递对象
- c++ - 如何使用 dbgeng.h 实现命令的文本自动完成?
- javascript - 在电子中启动 devtools 的问题 - vue 应用程序
- tableau-api - 根据日期粒度聚合值
- python - 在 Python Selenium 中等待一个值大于或等于某个数字
- reactjs - React js xlsx 文件下载