1

My maven build is working fine on a local computer, but is failing on the Jenkins integration server because of the following error:

[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: D:\Jenkins\workspace\XXX\XXX
[INFO] Storing buildNumber: null at timestamp: XXXX
[WARNING] Cannot get the branch information from the git repository: 
Detecting the current branch failed: 'git' is not recognized as an internal or external command,
operable program or batch file.

As far as I understand, it's because git isn't in the %PATH% of my Jenkins, which seems wrong git --version works fine within a terminal in the Jenkins server.

  • According to this Jenkins and maven-buildnumber-plugin, the work-around for SVN is to use the svnjava implementation. Is there the same kind of work-around for git?

  • Any ideas how I can fix the PATH for Jenkins?

Thanks a lot!!

Community
  • 1
  • 1
Nicolas C
  • 1,584
  • 2
  • 17
  • 33

1 Answers1

1

Ok, Jenkins was not using the %PATH% environment variable from the command line, but it's own %PATH% variable, defined in "configure" page of the "node". Adding git into this PATH variable fixed my problem.

Sorry for the noise.

Nicolas C
  • 1,584
  • 2
  • 17
  • 33