Mercurial Maven Release插件问题 [英] Mercurial Maven Release plugin problems

查看:130
本文介绍了Mercurial Maven Release插件问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢使用Maven和Mercurial(BitBucket)之类的分布式SCM.

I love using Maven and distributed SCMs like Mercurial (BitBucket).

然而,随着我扩大项目规模和增加Hg存储库的数量,我发现Maven Release插件的使用越来越麻烦.

However as I bring my project to scale and my Hg repository grows, I am finding the Maven Release plugin more and more cumbersome to work with.

主要问题是,当调用mvn release:prepare时,Maven不会利用Hg的分布式特性,而是执行整个存储库的完整克隆以放入临时目录.

The primary problem is that when a mvn release:prepare is called Maven doesn't take advantage of the distributed nature of Hg and performs a full clone of the entire repository to put into a temporary directory.

Fabrizio Giudici 早在2009年就很好地记录了该问题 http://weblogs.java.net/博客/fabriziogiudici/archive/2009/10/29/fixing-two-problems-maven-mercurial-hudson

The issue is very well documented by Fabrizio Giudici back in 2009 http://weblogs.java.net/blog/fabriziogiudici/archive/2009/10/29/fixing-two-problems-maven-mercurial-hudson

我本以为Sonatype可能现在已经更新了插件,但是a,我们仍然必须在发布之前下载整个仓库.

I would have thought Sonatype might have updated the plugin by now, but alas we are still having to download the entire repo prior to releasing.

我希望与StackOverflow社区联系,看看是否还有其他人遇到此问题,以及是否有人想出了新的方法来解决Maven发行版中的令人恐惧的完整克隆.

I was hoping to reach out to the StackOverflow community to see if anyone else was experiencing this problem and whether anybody has come up with novel ways of solving the dreaded full clone upon a maven release.

推荐答案

这是我为避免使用Maven愚蠢地多重推销而采取的措施:

This is what I do to avoid the silly multi push to mercurial with maven:

首先请确保通过以下方式使用正确版本的scm插件来处理scm:

First make sure you use the correct version of the plugin handling the mercurial type of scm via:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
        <tagNameFormat>@{project.version}</tagNameFormat>
    </configuration>
</plugin>

然后先执行准备目标

mvn release:prepare -DautoVersionSubmodules=true -DreleaseVersion=x.x.x -DdevelopmentVersion=y.y.y-SNAPSHOT -DpushChanges=false

请注意pushChanges=false属性

if all ok then
    hg push
    mvn release:perform
else
    mvn release:clean
    and have fun removing the changeset from local hg repo
endif

这篇关于Mercurial Maven Release插件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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