Abdul
Abdul

Reputation: 31

Build Failure When Running Through Jenkins

I am getting the below error when running through Jenkins. Please help me to resolve this.

Started by an SCM change Building in workspace
> C:\Users\xxxx\.jenkins\jobs\GITMavenJenkins\workspace
 > C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/Tharvez/WebDriverMaven.git # timeout=10
Fetching upstream changes from https://github.com/Tharvez/WebDriverMaven.git
 > C:\Program Files\Git\bin\git.exe --version # timeout=10
 > C:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress +refs/heads/*:refs/remotes/origin/*
 > C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
 > C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 1a92ef90881699bc930d65972afb424bc25c1fad (refs/remotes/origin/master)
 > C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
 > C:\Program Files\Git\bin\git.exe checkout -f 1a92ef90881699bc930d65972afb424bc25c1fad
 > C:\Program Files\Git\bin\git.exe rev-list 466b6f470e5784434b5b2e25cce577a452b5b7c0 # timeout=10
[workspace] $ cmd.exe /C '"mvn.bat clean package && exit %%ERRORLEVEL%%"'
'mvn.bat' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

Upvotes: 3

Views: 2503

Answers (2)

yorammi
yorammi

Reputation: 6458

It fails to find mvn.bat script file. It depends how you run maven. is it in 'execute shell' step by running mvn.bat? If so, then it looks for the file in the machine PATH.

Upvotes: 0

Bruno Lavit
Bruno Lavit

Reputation: 10382

mvn.bat' is not recognized as an internal or external command, operable program or batch file

Please declare your Maven installation in the global configuration (my Jenkins is running on Linux):

enter image description here

And please use this Maven version in your Jenkins jobs, it should solve your pb:

enter image description here

Upvotes: 1

Related Questions