大家好,
我正在尝试将jenkins,git,maven,corbetura集成到一个java项目中。
我已经在jenkins中集成并构建了一个工作,显示以下错误
Building in workspace /var/lib/jenkins/jobs/integration project/workspace git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git config remote.origin.url https://github.com/syedirfan7/test1.git # timeout=10
Fetching upstream changes from https://github.com/syedirfan7/test1.git
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress https://github.com/syedirfan7/test1.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision ad31beeb92f9cde2f43d8534c6043f350fbd1c02 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f ad31beeb92f9cde2f43d8534c6043f350fbd1c02
First time build. Skipping changelog.
[workspace] $ mvn clean package
FATAL: command execution failed
java.io.IOException: Cannot run program "mvn" (in directory "/var/lib/jenkins/jobs/integration project/workspace"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:240)
at hudson.Proc$LocalProc.<init>(Proc.java:212)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.Launcher$ProcStarter.join(Launcher.java:388)
at hudson.tasks.Maven.perform(Maven.java:331)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 15 more
Build step 'Invoke top-level Maven targets' marked build as failure
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: Test reports were found but none of them are new. Did tests run?
For example, /var/lib/jenkins/jobs/integration project/workspace/business/impl/target/surefire-reports/TEST-com.in28minutes.example.layering.business.client.ClientBOMockitoTest.xml is 2 hr 11 min old
Finished: FAILURE
我通过git bash从我的系统推送了存储库
答案 0 :(得分:1)
日志中没有超时,但是如果您阅读了堆栈跟踪,那么您会看到它:
java.io.IOException:无法运行程序&#34; mvn&#34; (在目录&#34; / var / lib / jenkins / jobs / integration project / workspace&#34;):error = 2,没有这样的文件或目录
因此,没有安装Maven(即mvn
命令),或者Jenkins正在使用的PATH上没有它。