每次我尝试运行构建时,我都会得到一堆这样的行:
/Users/Shared/Jenkins/Home/jobs/dghhtreew/workspace/build.xml:28:
The following error occurred while executing this line:
/Users/Shared/Jenkins/Home/jobs/dghhtreew/workspace/build.xml:39: Execute failed: java.io.IOException: Cannot run program "pdepend": error=2, No such file or directory
这是我的 build.xml 中的相关部分,它是由 PHP 项目向导自动生成的:
...
<target name="parallelTasks" description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc and phploc tasks in parallel using a maximum of 2 threads.">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="phpdoc"/>
<antcall target="phploc"/>
</parallel>
</target>
<target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
<exec executable="pdepend">
<arg line="--jdepend-xml=${basedir}/build/logs/jdepend.xml
--jdepend-chart=${basedir}/build/pdepend/dependencies.svg
--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg
${source}" />
</exec>
</target>
...
显然 Jenkins 用户找不到这些命令或其他东西。当我像这样通过终端登录到 Jenkins 时:
sudo -s -H -u jenkins
并尝试pdepend
按预期工作。但由于某种原因,它在从 Jenkins 服务器执行时不起作用。我尝试在可执行行中设置绝对路径,但我得到了相同的结果。我没有弄乱安装或任何东西,我通过mac 安装程序获得了 Jenkins 的最新版本(1.488) 。
为什么詹金斯什么都做不了??