【问题标题】:Seeing a Maven compiler error while running a selenium script using maven on Jenkins在 Jenkins 上使用 maven 运行 selenium 脚本时看到 Maven 编译器错误
【发布时间】:2019-03-11 11:59:52
【问题描述】:

我正在使用 selenium 和 maven 学习自动化。我想从 jenkins(CI) 学习运行 selenium 代码的艺术。我在 Jenkins 中设置构建项目时做的大部分事情都是正确的,当我尝试从 jenkins 内部构建代码时,我得到一个 maven 编译器错误,maven clean 错误。当我从命令行运行相同的代码时,构建成功并且我能够打开浏览器。从 Eclipse 编辑器内部运行代码也是如此。问题似乎只有当我从詹金斯内部运行脚本时。

我在这里附上错误信息供大家参考。

Started by user vinyas Jain
Building in workspace /Users/vinyasjain/eclipse-workspace/testProject2
Parsing POMs
Established TCP socket on 60998
[testProject2] $ /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/contents/Home/bin/java -cp /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.12.jar:/usr/local/Cellar/maven/3.6.0/libexec/boot/plexus-classworlds-2.5.2.jar:/usr/local/Cellar/maven/3.6.0/libexec/conf/logging jenkins.maven3.agent.Maven35Main /usr/local/Cellar/maven/3.6.0/libexec /Users/Shared/Jenkins/Home/war/WEB-INF/lib/remoting-3.27.jar /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.12.jar /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12.jar 60998
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /Users/vinyasjain/eclipse-workspace/testProject2/pom.xml test
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< testProject2:testProject2 >----------------------
[INFO] Building testProject2 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ testProject2 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ testProject2 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.819 s
[INFO] Finished at: 2019-03-11T17:17:31+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project testProject2: Error while storing the mojo status: /Users/vinyasjain/eclipse-workspace/testProject2/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst (Permission denied) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[JENKINS] Archiving /Users/vinyasjain/eclipse-workspace/testProject2/pom.xml to testProject2/testProject2/0.0.1-SNAPSHOT/testProject2-0.0.1-SNAPSHOT.pom
channel stopped
Finished: FAILURE
    

   

注意:

  • 问题似乎与编译时删除文件(目标文件夹)有关
  • 我正在开发 MAC 操作系统。

非常感谢您提供帮助。提前致谢。

【问题讨论】:

    标签: java maven selenium testing jenkins


    【解决方案1】:

    问题的根本原因是 Jenkins 的权限错误:

    [错误] .... plugin/compile/default-compile/inputFiles.lst(权限 拒绝)-> [帮助 1]

    当您通过 Jenkins 开始工作时,您以 jenkins 用户 的身份开始了您的测试,而当您开始时,该用户无权在您的文件系统中创建/删除文件夹在命令提示符下进行测试,您以 当前用户 身份开始测试,并且该用户拥有更多权限

    请更改 jenkins 用户 的权限并重试或使用 root 用户

    启动 Jenkins

    【讨论】:

    • 我需要为 jenkins 用户更改哪些权限以及如何做到这一点?
    • 有人对上述关于如何更改詹金斯用户权限的问题有答案吗?
    • 看看这个答案以更改詹金斯用户superuser.com/questions/114422/…的权限
    • 我浏览了上面的文章,仍然没有看到问题的解决方案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-08
    • 1970-01-01
    • 2015-10-21
    • 1970-01-01
    • 2017-01-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多