在Jenkins上使用maven运行selenium脚本时看到Maven编译器错误

问题描述 投票:-1回答:1

我正在学习使用硒与maven的自动化。我想学习运行jenkins(CI)的硒代码的艺术。我在Jenkins内部设置构建项目时正在做大多数事情,当我尝试从jenkins内部构建代码时,我得到maven编译器错误,maven clean错误。当我从命令行运行相同的代码时,构建成功,我能够打开浏览器。从eclipse编辑器中运行代码也是如此。问题似乎只有在我从jenkins内部运行脚本时才会出现。

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

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个回答
0
投票

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

[ERROR] .... plugin / compile / default-compile / inputFiles.lst(Permission denied) - > [Help 1]

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

请更改jenkins用户的权限,然后重试或使用root用户启动Jenkins

© www.soinside.com 2019 - 2024. All rights reserved.