我试图从 Solaris 盒子上的 Jenkins 的 CVS 存储库中提取。Jenkins 在 Tomcat 下运行,CVS 与 Jenkins 和 Tomcat 在同一台机器上。当我尝试设置从 CVS 提取的 Jenkins 作业时,它会失败并显示以下堆栈跟踪:
Building in workspace /home/tomcat/.jenkins/jobs/compile xml/workspace
cvs checkout -P -D 23 May 2013 15:49:46 -0800 -d workspace xml
ERROR: CVS Authentication failed: Connection error
org.netbeans.lib.cvsclient.connection.AuthenticationException: Connection error
at org.netbeans.lib.cvsclient.connection.LocalConnection.openConnection(LocalConnection.java:102)
at org.netbeans.lib.cvsclient.connection.LocalConnection.open(LocalConnection.java:145)
at org.netbeans.lib.cvsclient.Client$1.run(Client.java:374)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Cannot run program "cvs": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at java.lang.Runtime.exec(Runtime.java:328)
at org.netbeans.lib.cvsclient.connection.LocalConnection.openConnection(LocalConnection.java:95)
... 3 more
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:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 7 more
ERROR: Cvs task failed
在我看来,詹金斯找不到 cvs。当我以 tomcat 身份登录并键入 cvs 时,该命令有效。如果我在 Jenkins 中创建作业并从 shell 任务运行 cvs 命令,则该命令有效。如果我回显环境变量,例如 PATH 或 CVSROOT,我会得到预期的结果。
Jenkins 在哪里寻找 cvs?如何设置它的路径以便它可以看到 cvs?
-更新-
这看起来很相似:https://issues.jenkins-ci.org/browse/JENKINS-12633但我在服务器上安装了 cvs