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!!