-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
Windows 7
I'm trying to perform a Maven release on my project with Hudson Mercurial Plugin. I have a local Mercurial repository and I'm pushing my changes to a remote repository for Hudson to poll them.
My hudson job configuration looks as follows:
Mercurial Repository URL: http://repo (path to the remote repository)
Mercurial Repository Browser: hgweb
Maven release build release goals and options: -Dresume=false release:prepare release:perform
For reference I have the following in my pom.xml:
<scm>
<connection>scm:hg:http://repo</connection>
<developerConnection>scm:hg:http://repo</developerConnection>
</scm>
All regular (i.e. non-release builds) are performing succesfully. Hudson detects changes in the remote repository and performs "hg update". When I perform a Maven Release using the Hudson Maven Release Plug-In Plug-In, it's executing "hg status", "hg commit" and "hg push http://repo". The last command fails with the following message:
[INFO] EXECUTING: cmd.exe /X /C "hg push http://repo"
[ERROR]
EXECUTION FAILED
Execution of cmd : push failed with exit code: 1.
Working directory was:
C:\hudson\jobs\MyProject\workspace
Your Hg installation seems to be valid and complete.
Hg version: 1.5.1 (OK)
I found out that I can workaround this problem by creating an additional remote repository on the same server and point the SCM connection strings in my pom.xml to that new repository. When I do it like that it runs without error. Only thing is, I don't want to have two remote repositories for each project and I want my SNAPSHOT version to be automatically updated (like I have with SVN).
The error diagnostics on stdout gave me the following message:
abort: push creates new remote heads on branch 'default'!
I figured that this might have something to do with having uncommitted changes made by the Hudson Mercurial Plugin which prevents me from pushing. The output from "hg status" gave me:
? pom.xml.releaseBackup
? release.properties
So, I added those files to my .hgignore file and committed. After I did this, I was able to push to the remote server. Now I can also perform Maven releases from Hudson without problems. Still I think this isn't a very neat solution. I also posted this on Hudson forums.