我在试着让詹金斯弄明白。我有一套selenium测试,可以通过Eclipse构建和运行,也可以通过命令行使用ant构建和运行,但是每当我尝试Jenkins时,它们都会失败。Jenkins提供的控制台报告说,在我的ws.jars文件中定义的build.xml值不存在;但是,该目录确实存在!同样,从命令行构建没有问题。
任何建议都将是非常感谢的,因为我已经尝试了几天来解决这个问题。
谢谢。
我的build.xml文件:
<property environment="env"/>
<property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="/Users/username/Documents/All JAR Files/All in one place"/>
<property name="test.dest" value="${ws.home}/build"/>
<property name="test.src" value="${ws.home}/src"/>
<property name="ng.result" value="test-output"/>我在build.xml文件中创建了一个名为path的新目标。这是我和Jenkins一起运行时的输出。
Started by user anonymous
Building in workspace /Users/<user>/local_repo/qa-automation/selenium-java/my-projects
[my-projects] $ /Users/Shared/Jenkins/Home/tools/hudson.tasks.Ant_AntInstallation/Install_automatically/bin/ant path
Buildfile: /Users/<user>/local_repo/qa-automation/selenium-java/my-projects/build.xml
path:
[echo]
[echo] My path - /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin:/usr/bin:/bin:/usr/sbin:/sbin
[echo]
BUILD SUCCESSFUL
Total time: 0 seconds
Finished: SUCCESS发布于 2015-11-13 14:37:02
谢谢大家的建议。我已经有一段时间没有想过这个问题了,但昨晚我有一些时间,能够再次解决这个问题。正如“rgulia”所指出的,这与在非交互式shell中执行的Jenkins作业有关。因此,最后,我尝试将我的ws.jars目录复制到/Users/Shared/Jenkins,将所有者更改为'jenkins',然后我的构建就能够继续进行了。
原来的错误信息太误导人了。不是目录不存在,而是“jenkins”没有对它的访问和/或权限。我希望这些信息能帮助到其他人。
发布于 2015-11-07 04:01:16
我怀疑这是由ws.jars路径中的空格造成的。您应该通过添加\来转义这些空格,尝试更改路径:
<property name="ws.jars" value="/Users/username/Documents/All JAR Files/All in one place"/>有了这个:
<property name="ws.jars" value="/Users/username/Documents/All\ JAR\ Files/All\ in\ one\ place/"/>https://stackoverflow.com/questions/33574964
复制相似问题