[英]I am getting the following error when I run mvn on OS X Mavericks: Cannot run program “/bin/sh”: error=2, No such file or directory
[英]Cannot run program "mvn" error=2, No such file or directory
我正在我的 Ubuntu 14.04 LTS 上進行構建,但我得到以下信息:
Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/videovixx
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url https://bitbucket.org/mdennis10/videovixx.git # timeout=10
Fetching upstream changes from https://bitbucket.org/mdennis10/videovixx.git
> /usr/bin/git --version # timeout=10
using .gitcredentials to set credentials
> /usr/bin/git config --local credential.helper store -- file=/tmp/git6236060328558794078.credentials # timeout=10
> /usr/bin/git fetch --tags --progress https://bitbucket.org/mdennis10/videovixx.git +refs/heads/*:refs/remotes/origin/*
> /usr/bin/git config --local --remove-section credential # timeout=10
> /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision f5c53e95d33c1e15abd7519346c18ec6bc0c81d7 (refs/remotes/origin/master)
> /usr/bin/git config core.sparsecheckout # timeout=10
> /usr/bin/git checkout -f f5c53e95d33c1e15abd7519346c18ec6bc0c81d7
> /usr/bin/git rev-list f5c53e95d33c1e15abd7519346c18ec6bc0c81d7 # timeout=10
[videovixx] $ mvn install package
FATAL: command execution failed
java.io.IOException: Cannot run program "mvn" (in directory "/var/lib/jenkins/workspace/videovixx"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:802)
at hudson.Launcher$ProcStarter.start(Launcher.java:380)
at hudson.Launcher$ProcStarter.join(Launcher.java:387)
at hudson.tasks.Maven.perform(Maven.java:328)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
at hudson.model.Run.execute(Run.java:1745)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
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:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 15 more
Build step 'Invoke top-level Maven targets' marked build as failure
Archiving artifacts
Recording test results
Finished: FAILURE
我假設這是由一些 linux 安全功能引起的,該功能阻止 /var/lib/jenkins/workspace/videovixx 在沒有我可能沒有的正確權限的情況下創建。 這是問題嗎?我該如何解決?
這里有很多東西。
您要么沒有在作業配置中選擇 Maven 版本。 或者你沒有配置 Jenkins 來安裝 Maven 版本。 或者您希望在 Slave 上使用本地安裝的 Maven,但它沒有為jenkins
用戶配置。
由於我不知道您已配置(或未配置)什么以及您希望使用什么,我無法直接回答,但我可以解釋它是如何工作的。
jenkins
用戶啟動它
sudo jenkins
,然后在你的 Slave 上執行mvn
以驗證jenkins
用戶可以運行mvn
Default
。 這是使用在節點本地安裝的版本的設置我遇到了同樣的問題,我在 Jenkins Server 中安裝了 maven,問題得到了解決。
sudo yum install maven
在全局配置 Maven 后,創建構建一個 maven2/3 項目作業,而不是構建一個自由樣式的軟件項目,然后構建聲納工作正常!
我遇到了同樣的問題,我在全局工具配置中添加了 maven,但沒有奏效。 原因是我的實例是在此處新創建的輸入圖像描述。 之后我安裝了maven,它起作用了。
我在 colab 上遇到了同樣的問題,我在 Jenkins Server 中安裝了 mav 並修復了問題。
!sudo apt install maven
import imagej;
ij = imagej.init();
print(ij.getVersion())
我有同樣的問題,但我的解決方案結果非常具體。 無論如何我都發布它,有人可能會遇到同樣的問題。
在這發生之前,我已經安裝了一個新的 JDK。 即使 Maven 聲明它使用正確的 Java 版本(從mvn -version
顯示),安裝似乎也存在問題,要么沒有完全完成,要么 Maven 沒有正確注冊新版本。 我真的不知道,但是在嘗試了兩個小時之后,我決定重新啟動 Ubuntu,然后問題就消失了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.