每次我尝试运行构建,我收到了一堆线是这样的:詹金斯在Mac:不能运行程序“pdepend”
/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>
...
显然,詹金斯用户无法找到这些命令或东西。当我通过终端詹金斯这样登录:
sudo -s -H -u jenkins
,并尝试pdepend
它按预期工作。但由于某些原因,它在Jenkins服务器上执行时不起作用。我试着在可执行文件行中设置绝对路径,但我得到了相同的结果。我没有搞砸安装或任何东西,我有最新版本(1.488)詹金斯通过mac installer。
为什么不能jenkins做什么?
如前所述上面:“我试图在可执行行设置绝对路径,但我只是得到了同样的结果。” –
@MikeFunk答案已更新 –