scm标签放在哪里?
我的 pom.xml 文件中的 scm 标记有一点问题。
我的项目架构是这样的:
Parent
Submodule1
Submodule2
reactor
Parent是保存所有maven插件配置、库版本等的项目。它是reactor项目的父项目,也是所有子模块的父项目。
Reactor 是一个 pom.xml,其中包含编译所有子模块的标签。
我想将 scm 标签放在父 pom.xml 上,因为它是更高的 pom.xml。但是当我想做“mvn release:prepare”时出现错误。
所以我将 scm 标签放入reactor pom.xml 中,它就可以工作了。
这对我有好处,它有效:)但我不明白为什么我需要将 scm 标签放在reactor pom 中。
有人可以向我解释这种行为吗?
谢谢。
编辑:
这是文件夹结构:
root
parent
pom.xml (parent)
submodule1
pom.xml
submodule2
pom.xml
pom.xml (reactor)
这是pomreactor有趣的部分:
<parent>
<groupId>groupId</groupId>
<artifactId>parent</artifactId>
<relativePath>./parent/pom.xml</relativePath>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modules>
<module>parent</module>
<module>submodule1</module>
<module>submodule2</module>
</modules>
最后,这是发布的错误:准备:
[INFO]无法标记SCM 提供者消息: svn tag 命令失败。 命令输出: svn:版本 112 中不存在路径“http://10.211.55.4/svn/trunk/reactor”
I have a little probleme with the scm tag in my pom.xml file.
My project architecture is like this:
Parent
Submodule1
Submodule2
reactor
Parent is the project which hold all maven plugins configuration, librairies version ect. It's the parent of reactor project which is the parent of all submodules.
Reactor is a pom.xml which contains tags to compile all submodules.
I would like put the scm tag on the parent pom.xml because it's the higher pom.xml. But I get an error when I want to do a "mvn release:prepare".
So I put the scm tag in the reactor pom.xml and it works.
It's good for me, it works :) but I don't understand why I need to put the scm tag in the reactor pom.
Someone can explain me this behavior ?
Thanks.
Edit:
Here is the folder structure:
root
parent
pom.xml (parent)
submodule1
pom.xml
submodule2
pom.xml
pom.xml (reactor)
Here is the interesting part of pom reactor:
<parent>
<groupId>groupId</groupId>
<artifactId>parent</artifactId>
<relativePath>./parent/pom.xml</relativePath>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modules>
<module>parent</module>
<module>submodule1</module>
<module>submodule2</module>
</modules>
Finally, here is the error for the release:prepare:
[INFO] Unable to tag SCM
Provider message:
The svn tag command failed.
Command output:
svn: Path 'http://10.211.55.4/svn/trunk/reactor' does not exist in revision 112
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一个要求是 SVN 中存在主干、标签和分支文件夹,我认为但是
您必须仅在反应器中定义 scm 部分,而不是在父级中定义。
此外,您还应该使用 true 定义 maven-release-plugin (反应器)。
这种情况的默认处理是 Maven 将对 SVN 路径进行相对更改。这会产生像你一样的麻烦。所以你必须将信息放入reactor pom而不是父pom中。非常重要的是只有一个配置。
此外,我建议删除父级并将信息放入反应器中,因为您会在站点生成阶段遇到麻烦。
First requirement is that trunk, tags and branches folder in SVN exist which i assuem but
you have to define the scm part only in the reactor and not in the parent.
Furthermore you should define the maven-release-plugin (reactor) as well with true.
The default handling of such situation is that Maven will do relative changing of the SVN paths. This will produces trouble like you have. So you have to put the information into the reactor pom NOT into the parent pom. Very important is to have only a single configuration.
Furthermore i would recommend to remove the parent and put the information into the reactor, cause you would get trouble during site generation phase.