使用git的maven发布插件在子文件夹中不起作用

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

我们使用git和maven-modules的maven-release-plugin有问题。

我们有以下项目结构:

pom.xml(ApplicationTest and ApplicationConf are modules)

ApplicationWeb

---pom.xml(parent pom in root folder)

ApplicationTest

---pom.xml(parent pom in root folder)

ApplicationConf

---pom.xml(All environments are modules. This has no parent pom)

---ConfDev

-------pom.xml(parent ApplicationConf)

---ConfTst

-------pom.xml(parent ApplicationConf)

---ConfAcc

-------pom.xml(parent ApplicationConf)

---ConfPrd

-------pom.xml(parent ApplicationConf)

现在我们想发布dev config(Parent已经发布)。这是通过在ApplicationConf / ConfDev / pom.xml上执行maven发布。

现在发布准备失败了,因为它在想要推送已更改的内容时使用了错误的git url。它附加了我们想要释放到git url的pom的工件id。

http://gitrepourl/git_repo.git/artifact-id

我们在ApplicationConf中定义了pom中的scm设置,因此是所有环境的根。

<scm>
  <developerConnection>scm:git:http://gitrepourl/git_repo.git</developerConnection>
</scm>

我们是否有错误的项目结构,错误的设置或者这是maven-release-plugin中的错误?

使用版本:

maven-release-plugin 2.3.2和2.4.1

Maven 3.0.5

可能的方法:

从配置父pom中删除所有配置项目作为模块,并添加到每个pom更多scm信息,所以它看起来像这样:

<scm>
<url>https://github.com/XXX/YYY</url>
<connection>scm:git:ssh://[email protected]/XXX/YYY.git</connection>
<developerConnection>scm:git:ssh://[email protected]/XXX/YYY.git</developerConnection>

现在我能够在每个pom上执行发布。这是正确的溶剂吗?

git maven maven-release-plugin maven-module
1个回答
0
投票

Maven自动将submodul artifactId添加到scm / connection-URLs。要修复它,您必须将scm-Node从父节点复制到每个子模块。

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