Maven Release Fails On Named Branches

Our project uses Jenkins M2 Release Plugin to help perform releases of software using Jenkins. It is a nice, little tool that is easy to configure and use.

Recently we encountered a strange failure when trying to perform a release from one of our support branches. We use mercurial as our SCM and the logs showed the failure occuring when the plugin was trying to push after tagging the branch with it’s released label.

[INFO] EXECUTING: cmd.exe /X /C "hg push -rORE-BRANCH"

But wait, our supporting branch is named CORE-BRANCH, not ORE-BRANCH. Google turned up the following bug against maven scm.

The plugin uses some buggy code that strips off a portion of the branch name while parsing the hg command. The result is that the branch name is substringed if it begins with a set of SCM identifiers or status codes such a ‘C’ in our case.

You can see the list of idenitifiers that will be stripped here if you are curious.

Since this issue is still open, our solution was to re-name our support branch to something that wouldn’t get trimmed.

It's only fair to share...
Share on Facebook
Tweet about this on Twitter
Share on LinkedIn