5

我在 redhat linux 机器上运行 Jenkins。我的构建是一个包含 selenium 测试的 maven 2.2.1 项目。我在一个运行良好的 ubuntu 机器上进行了相同的设置,但是当我尝试在我的 redhat VM 上调用相同的顶级 maven 命令时,我收到以下错误。

org.apache.maven.surefire.booter.SurefireExecutionException: Unable to create file for report: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied); nested exception is java.io.FileNotFoundException: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied); nested exception is 
org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied); nested exception is java.io.FileNotFoundException: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied)
org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied); nested exception is        
java.io.FileNotFoundException: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied)
java.io.FileNotFoundException: /var/lib/jenkins/jobs/selenium/workspace/target/surefire-reports/com.MyComp.bio.PreferencesTest.txt (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
at java.io.FileWriter.<init>(FileWriter.java:90)
at org.apache.maven.surefire.report.AbstractFileReporter.testSetStarting(AbstractFileReporter.java:57)
at org.apache.maven.surefire.report.ReporterManager.testSetStarting(ReporterManager.java:219)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

在尝试解决这个问题时,我重新启动了 Jenkins

sudo service jenkins restart

但它仍然存在。有人遇到过这个吗?

4

1 回答 1

3

用于ls -al显示文件的权限。

有关更多信息,请参阅此链接

阅读服务启动脚本以检查运行 Jenkins 的用户的名称。

less /etc/init.d/jenkins

您可能已经手动将 jenkins 安装到了 Java EE 容器,例如 tomcat6。如果是这种情况,您应该使用:

less /etc/init.d/tomcat6

于 2012-10-10T08:22:58.883 回答