通过Jenkins运行时构建失败

时间:2015-12-14 06:45:51

标签: maven jenkins

通过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

2 个答案:

答案 0 :(得分:1)

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

请在全局配置中声明您的Maven安装(我的Jenkins在Linux上运行):

enter image description here

请在你的Jenkins工作中使用这个Maven版本,它应该解决你的pb:

enter image description here

答案 1 :(得分:0)

无法找到 mvn.bat 脚本文件。 这取决于你如何运行maven。 是在执行shell'逐步运行 mvn.bat ?如果是,则它在机器路径中查找文件。