Mercurial Maven Release plugin problems

﹥>﹥吖頭↗ 提交于 2019-12-10 15:11:16

问题


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

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.

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.

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

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.

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.


回答1:


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

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>

then execute first the prepare goal

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

note the pushChanges=false attribute

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


来源:https://stackoverflow.com/questions/11769537/mercurial-maven-release-plugin-problems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!