Reputation: 17366
I'm using Mercurial (hg) as my source control tool and Maven as build system.
While performing release process (using versions-maven-plugin: versions:set -Dxxx=yyy versions:use-releases xxxxx yyy targets), I got valid pom files to perform a valid release build on a project.
Now, when release build is successful, next step is to commit the changed files (changed by versions plugin), I'm using maven-scm-plugin (scm:checkin and scm:tag). As my source control tool is Mercurial/hg, scm:xxx operations will call hg commands (instead of svn or any other tool - just FYI).
I have valid settings for <scm>. for connection and developerConnection..<scm>
so scm:checkin worked as expected.
But I'm getting the following error while scm:tag is initiated. Any ideas what wrong I'm doing?
PS:
1. The same operations (scm:checkin and scm:tag) works successfully in other projects.
2. I'm NOT using maven-release-plugin
16:05:52 [INFO] --- maven-scm-plugin:1.9.2:tag (default-cli) @ project-parent ---
16:05:52 [INFO] Final Tag Name: '0.0.1'
16:05:52 [INFO] EXECUTING: /bin/sh -c cd /production/jenkins/tools/workspace/ProjectTestApp && hg tag --message 'CM Jenkins - Release plugin auto check-in and creation of release tag = 0.0.1' 0.0.1
18:33:30 [ERROR]
18:33:30 EXECUTION FAILED
18:33:30 Execution of cmd : tag failed with exit code: 255.
18:33:30 Working directory was:
18:33:30 /production/jenkins/tools/workspace/ProjectTestApp
18:33:30 Your Hg installation seems to be valid and complete.
18:33:30 Hg version: 1.9.2 (OK)
16:05:52 [INFO] ------------------------------------------------------------------------
16:05:52 [INFO] BUILD FAILURE
16:05:52 [INFO] ------------------------------------------------------------------------
16:05:52 [INFO] Total time: 7.082 s
16:05:52 [INFO] Finished at: 2014-09-25T16:05:52-05:00
16:05:53 [INFO] Final Memory: 14M/360M
16:05:53 [INFO] ------------------------------------------------------------------------
16:05:53 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.9.2:tag (default-cli) on project project-parent: Cannot run tag command : Exception while executing SCM command. Error while executing command tag --message 'CM Jenkins - Release plugin auto check-in and creation of release tag = 0.0.1' 0.0.1 -> [Help 1]
16:05:53 [ERROR]
16:05:53 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
16:05:53 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
16:05:53 [ERROR]
16:05:53 [ERROR] For more information about the errors and possible solutions, please read the following articles:
16:05:53 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
16:05:53 Archiving artifacts
16:05:54 Finished: FAILURE
Upvotes: 2
Views: 4015
Reputation: 17366
The issue was with the tag already in place in hg/mercurial (recently I was playing with a POC work and applied 0.0.1 tag in Hg manually from command line).
That said, either bump the version# in the project's pom.xml file to use a newer x.x.x-SNAPSHOT and release that x.x.x (which is not 0.0.1) OR hg clone the project (or checkout in SVN) and run the following (in my case tag was 0.0.1):
hg tag --remove 0.0.1
hg push
After the above commands, I made sure tag was gone in Hg (web browser for project-parent project) and tried release promotion process in Jenkins (which used versions-maven-plugin, maven-scm-plugin, enforcer plugin)... worked as expected.
Upvotes: 2