【发布时间】:2020-12-22 02:59:42
【问题描述】:
我该如何更改:
...
<dependencies>
...
<dependency>
<groupId>xyz</groupId>
<artifactId>abc</artifactId>
</dependency>
...
</dependencies>
...
到那个:
...
<dependencies>
...
<dependency>
<groupId>xyz</groupId>
<artifactId>abc</artifactId>
<scope>system</scope>
<systemPath>/.../src/main/.../some.jar</systemPath>
</dependency>
...
</dependencies>
...
基于“/dependencies/dependency/groupId”和“/dependencies/dependency/artifactId”的值
在 bash 中(通过 xmlstarlet,...)?
更新
显然这似乎不够清楚。 所以:代码必须找到 groupId==xyz 和 artifactId==abc 的依赖关系,然后(并且仅在那时)将两个 now 节点添加到 groupId 和 artifactId 节点的父节点。
【问题讨论】:
-
你从哪里得到 project.basedir 变量?
-
maven - 但这不是问题(更新它)
-
当你说依赖“dependencies/dependency/groupId”和“/dependencies/dependency/artifactId”时,逻辑是什么?它是否使用这些字段中的值?是否仅在存在某些值时才更新?
-
添加了进一步的解释
标签: xml sh xmlstarlet