Nicolas C
Nicolas C

Reputation: 1634

buildnumber-maven-plugin: 'git' is not recognized on Jenkins

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.

Thanks a lot!!

Upvotes: 1

Views: 1167

Answers (1)

Nicolas C
Nicolas C

Reputation: 1634

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.

Upvotes: 1

Related Questions