scm标签放在哪里? [英] Where placed the scm tag?

查看:289
本文介绍了scm标签放在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的pom.xml文件中的scm标记有点问题.

I have a little probleme with the scm tag in my pom.xml file.

我的项目架构是这样的:

My project architecture is like this:

Parent
Submodule1
Submodule2
reactor

父级是一个项目,其中包含所有maven插件配置,库版本等.它是反应堆项目的父级,也是所有子模块的父级.

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是pom.xml,其中包含用于编译所有子模块的标签.

Reactor is a pom.xml which contains tags to compile all submodules.

我想将scm标记放在父pom.xml上,因为它是较高的pom.xml.但是当我想执行"mvn release:prepare"时出现错误.

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".

因此,我将scm标记放入了反应堆pom.xml中,并且可以正常工作.

So I put the scm tag in the reactor pom.xml and it works.

对我很好,它可以工作:)但我不明白为什么我需要将scm标签放在反应堆pom中.

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 ?

谢谢.

这是文件夹结构:

root
  parent
    pom.xml (parent)
  submodule1
    pom.xml
  submodule2
    pom.xml
  pom.xml (reactor)

这是pom反应器的有趣部分:

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>

最后,这是release:prepare的错误:

Finally, here is the error for the release:prepare:

[INFO]无法标记SCM 提供者消息: svn tag命令失败. 命令输出: svn:修订版112中不存在路径"http://10.211.55.4/svn/trunk/reactor"

[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

推荐答案

第一个要求是SVN中存在主干,标签和分支文件夹,我对此表示怀疑,但是 您只需要在反应堆中定义scm部分,而不必在父对象中定义.

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.

  root
    +-- pom.xml (reactor)
    +-- parent
    !      +-- pom.xml (parent)
    +-- submodule1
    !      +-- pom.xml
    +-- submodule2
           +-- pom.xml

此外,您还应该使用true定义maven-release-plugin(反应器).

Furthermore you should define the maven-release-plugin (reactor) as well with true.

这种情况的默认处理是Maven将对SVN路径进行相对更改.这将像您一样产生麻烦.因此,您必须将信息放入反应堆pom中,而不要放入父pom中.非常重要的是只有一个配置.

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.

  root
    +-- pom.xml (parent)
    +-- submodule1
    !      +-- pom.xml
    +-- submodule2
           +-- pom.xml

这篇关于scm标签放在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆