【发布时间】:2023-03-06 14:27:01
【问题描述】:
我有一个 maven 项目,其中包含大量具有许多依赖项的子项目。现在我想将我的 pom 文件的所有版本更新为新版本并重建它们。例如,如果我有一个这样的 pom:
<parent>
<groupId>theparentId</groupId>
<artifactId>theParentArtifact</artifactId>
<version>2.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>eaics-wsa-model</artifactId>
<packaging>model</packaging>
<dependencies>
<dependency>
<groupId>groupId1</groupId>
<artifactId>artifactId1</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>groupId2</groupId>
<artifactId>artifactId2</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>groupId3</groupId>
<artifactId>artifactId3</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
我需要将 groupId1 到 groupId3 的依赖项更新为不存在 jet 的新版本。因为我还需要自己“创建”我的依赖项的新更新版本。
因为它们的 pom.xml 中的依赖项现在看起来像这样:
<groupId>groupId3</groupId>
<artifactId>artifactId3</artifactId>
<version>1.2</version>
如您所见,版本是 1.2 但需要更新到 1.3 才能使用依赖项。
那么有没有办法递归更新所有 pom(版本)?如果在 Java 中可以使用 MavenXpp3Reader 等,那就太好了。但是有没有更简单的方法呢?因为我担心在那之后我无法构建我的项目,因为我认为它们不会递归构建并且不会找到新的依赖版本。
【问题讨论】:
标签: maven dependencies maven-3