2

Is there any way to configure the buildNumber plugin with git as SCM provider in order to get the short commit id. Actually, this plugin work fine, but the id is too long : b0c1c69be579175e63eeb1c056d607f01ab61e96

I would like to have the shorter version : b0c1c69 With git command line it can be done with

 git rev-parse --short HEAD

As described Get the short git version hash

Community
  • 1
  • 1
Yev
  • 337
  • 4
  • 19
  • 1
    I have made a patch for maven-buildNumber plugin and submitted it to the project [JIRA-link](https://jira.codehaus.org/browse/MBUILDNUM-86). The improvement concerns only Git SCM. Normally, from the next release **1.1** of the plugin, there will be a new configuration keyword `LENGTH`, where `LENGTH` is an integer - the length of a commit ID. – Yev Feb 08 '12 at 12:24
  • 1
    more information about this improvement you can find http://yevgen-fr.blogspot.com/2012/02/maven-buildnumber-plugin-short-revision.html – Yev Feb 10 '12 at 06:47
  • See https://stackoverflow.com/a/43375126/54745 – Jason Harrison Apr 20 '19 at 05:09

0 Answers0