Mercurial Maven Connection Issues

I like to use Maven and distribute SCM like Mercurial (BitBucket).

However, as I add my project to scale and my Hg repository grows, I find the Maven Release plugin to work more and more cumbersome.

The main problem is that when a mvn release:prepareis called Maven, it does not use the distributed nature of Hg and performs a complete clone of the entire repository to be placed in a temporary directory.

The problem 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 that Sonatype might have updated the plugin by now, but alas, we still have to download the entire repo before the release.

I was hoping to contact the StackOverflow community to find out if anyone had this problem, and someone came up with new ways to solve the scary complete clone for maven release.

+5
source share
1 answer

This is what I do to avoid stupid multiple clicking on mercurial with maven:

First, make sure that you are using the correct version of the plugin that controls the scm mercurial type with:

<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 complete the preparation goal first

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

note the attribute 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
+12
source

All Articles