运行 Jenkins 时出现以下错误。请帮我解决这个问题。
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
最佳答案
mvn.bat' is not recognized as an internal or external command, operable program or batch file
请在全局配置中声明您的 Maven 安装(我的 Jenkins 在 Linux 上运行):
请在您的 Jenkins 作业中使用此 Maven 版本,它应该可以解决您的 pb:
关于maven - 通过 Jenkins 运行时构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34261159/