Maven发布插件在svn中创建递归目录

时间:2012-12-10 11:00:15

标签: maven jenkins maven-3 jenkins-plugins maven-release-plugin

我正在使用maven-release-plugin 2.3.2并能够prepare and perform release。问题是这个。

SVN回购: http://svnserver:8080/myrepo/test/projectA

Project A         
   |
    branches/
    tags/
    trunk/

当我第一次进行mvn release:perform时,它会在标签/文件夹中创建此结构

branches/
tags/
   |
    ProjectA_1.0.0
        | 
        branches/ <structure from the parent branches/ folder>
        tags/
        trunk/

当我第二次进行mvn release:perform时,这是输出

branches/
tags/
   |
    ProjectA_1.0.0
        | 
        branches/<structure from the parent branches/ folder>
        tags/
        trunk/
    ProjectA_1.0.1
        | 
        branches/<structure from the parent branches/ folder>
        tags/ProjectA_1.0.0/branches/<structure from the parent branches/ folder>
        tags/ProjectA_1.0.0/tags/
        tags/ProjectA_1.0.0/trunk
        trunk/

等等......整个1.0.1将被复制到1.0.2中,直到我有一个递归的噩梦:)

虽然如果我在Nexus中转到我的<releases>存储库,一切都没问题,我看到像

这样的干净目录
1.0.0
1.0.1
1.0.2

内有正确的文物。


我已经使用插件直接在命令行和Jenkins使用M2发布插件测试了这个。结果相同。这使我指向某处错误配置的方向,而不是我从何处或在何处调用它。


我对插件或scm代码做错了什么?

1 个答案:

答案 0 :(得分:4)

您必须定义要发布的项目的主干,并将其配置到pom.xml的scm区域中:

这意味着定义:

<scm>
  <connection>scm:svn:http://svnserver:8080/myrepo/test/projectA/trunk</connection>
  <developerConnection>scm:svn:http://svnserver:8080/myrepo/test/projectA/trunk</developerConnection>
</scm>

如果您有多模块构建,则必须仅在父级中定义,而不是在子级中定义。