发布期间错误提交:准备和发布:分支

时间:2012-11-22 08:42:26

标签: svn maven maven-release-plugin

我使用 maven发布插件2.3.2 maven 3.0.4 ,我在准备和分支阶段遇到了问题。

我有{strong> svn 路径,例如http:/svn.pyhost.com/projects/App1 App1 包含3个目录:

App1/trunk
App1/branches
App1/tags

trunk包含

App1/trunk/ApplicationParent
App1/trunk/ApplicationChild

所以,我想创建一个仅包含ApplicationParentApplicationChild的新标记。所以,我在我的pom.xml中创建了配置,我在这里添加了这样的内容:

<scm>   
<connection>http:/svn.pyhost.com/projects/App1/trunk</connection> 
<developerConnection>http:/svn.pyhost.com/projects/App1/trunk</developerConnection>
<url>http:/svn.pyhost.com/projects/App1/trunk</url>
</scm> 


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<tagBase>http:/svn.pyhost.com/projects/App1/tags</tagBase>
<branchBase>http:/svn.pyhost.com/projects/App1/branches</branchBase>
</configuration>
</plugin>
</plugins>
</build>

接下来,我执行了mvn release:prepare并且maven创建了新标记ApplicationParent-1.0,其中包含App1 (trunk, branches and tags)的所有标记,我不知道为什么,因为在scm我只设置了< / p>

http:/svn.pyhost.com/projects/App1/trunk所以我希望从trunk字典中标记所有内容,但是maven创建了ApplicationParent-1.0并放置了trunk, branches and tags个目录。为什么?

所以,我将我的scm更改为http:/svn.pyhost.com/projects/App1/trunk/ApplicationParent并再次执行mvn release:prepare,现在它很好,在ApplicationParent-1.1中我从trunk目录中获取了所有内容。

但是,如果我使用mvn release:branch执行http:/svn.pyhost.com/projects/App1/trunk/ApplicationParent,我只能使用ApplicationParent创建新分支,但我需要创建 所有主干词典的分支,所以我需要将scm更改为http://svn.pyhost.com/projects/App1/trunk/,如果我想创建分支,那就更好了。但是,如果我需要使用release:perform创建新标记,我会遇到上面描述的问题。

为什么我不能为http:/svn.pyhost.com/projects/App1/trunkrelease:perform使用release:branch之类的路径?

1 个答案:

答案 0 :(得分:1)

我觉得您的SCM的结构不是Maven Release Plugin所满意的。 following article explains some of the structures that the plugin understands

虽然支持您描述的格式,但您没有在pom.xml文件中反映这种格式和/或您尝试使用单个pom.xml文件来实现两个不同的项目(ApplicationParent vs ApplicationChild) 。

我建议将SCM重组为:

App1/ApplicationParent
    /trunk
    /tags
    /branches
    /releases
App1/ApplicationChild
    /trunk
    /tags
    /branches
    /releases

然后,您在ApplicationParent的pom.xml中的开发人员连接可以是:

<developerConnection>http:/svn.pyhost.com/projects/App1/ApplicationParent/trunk</developerConnection>

和标签/分支基地:

<tagBase>http:/svn.pyhost.com/projects/App1/ApplicationParent/tags</tagBase>
<branchBase>http:/svn.pyhost.com/projects/App1/ApplicationParent/branches</branchBase>

对于儿童项目:

<developerConnection>http:/svn.pyhost.com/projects/App1/ApplicationChild/trunk</developerConnection>

和标签/分支基地:

<tagBase>http:/svn.pyhost.com/projects/App1/ApplicationChild/tags</tagBase>
<branchBase>http:/svn.pyhost.com/projects/App1/ApplicationChild/branches</branchBase>

然而,我的个人品味只是从发布分支(例如/releases/x.y.z)而不是/ trunk执行发布插件。因此,您在SCM内部进行分支,然后签出新版本分支并执行发布:准备和发布:在发布分支上执行魔术。

不要忘记使用:“mvn release:prepare -DdryRun = true”,以便您可以在实际发布之前查看它将要执行的操作。一旦工作正常,您可以执行“发布:清理发布:准备发布:执行”作为单个maven命令。

相关问题