简体   繁体   English

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

[英]Seeing a Maven compiler error while running a selenium script using maven on Jenkins

I am learning automation using selenium with maven.我正在使用 selenium 和 maven 学习自动化。 I wanted to learn the art of running the selenium code from jenkins( CI).我想从 jenkins(CI) 学习运行 selenium 代码的艺术。 I am doing most things right while setting up build item inside Jenkins, when I try to build the code from inside jenkins I get a maven compiler error, maven clean error.在 Jenkins 内部设置构建项目时,我做的大部分事情都是正确的,当我尝试从 jenkins 内部构建代码时,我收到了 maven 编译器错误,maven clean 错误。 When I run the same code from the command line, the build succeeds and I am able to open the browser.当我从命令行运行相同的代码时,构建成功并且我能够打开浏览器。 Same goes for running the code from inside the eclipse editor.从 eclipse 编辑器内部运行代码也是如此。 The issue seems to be only when I run the script from inside jenkins.问题似乎只出现在我从 jenkins 内部运行脚本时。

I am attaching the error message here for everyones reference.我在这里附上错误信息供大家参考。

 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, ie 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

Note:笔记:

  • Issue seems to be related to deleting of files while compilation( target folder)问题似乎与编译时删除文件有关(目标文件夹)
  • I am working on a MAC operating system.我正在研究 MAC 操作系统。

Help on this is much appreciated.非常感谢这方面的帮助。 Thanks in advance.提前致谢。

Root cause of your problem is wrong permissions for Jenkins:您问题的根本原因是 Jenkins 的权限错误:

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

When you start job via Jenkins you started your tests as jenkins user and this user haven't permissions to create/delete folders in your file system, when you start tests in command prompt you start tests as your current user and this user have more permissions当您通过Jenkins开始工作时,您以jenkins 用户身份开始您的测试,而该用户无权在您的文件系统中创建/删除文件夹,当您在命令提示符下开始测试时,您以当前用户身份开始测试,而该用户拥有更多权限

Please change permissions for jenkins user and try again or start Jenkins using root user请更改jenkins 用户的权限并重试或使用root 用户启动 Jenkins

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过詹金斯运行Maven项目时出错 - Error while running maven project via Jenkins 1. 运行 Maven 项目(Selenium,Java)时发生编译错误和构建失败,运行方式-&gt; Maven 测试。如何修复此编译器错误 - 1. COMPILATION ERROR and BUILD FAILURE occurred while running the Maven project (Selenium, Java) , Run As-> Maven test .How to fix this compiler error Maven在Eclipse上看不到编译器 - Maven not seeing the compiler on Eclipse 从Jenkins服务器运行Maven自动化套件时出现错误 - Getting Error while running maven automation suite from Jenkins server NoClassDefFoundError: org/openqa/selenium/virtualauthenticator/HasVirtualAuthenticator 在使用 TestNG 和 Maven 运行测试时出错 - NoClassDefFoundError: org/openqa/selenium/virtualauthenticator/HasVirtualAuthenticator error while running test using TestNG and Maven Selenium 使用 Z9115C10980645C41313F244AC1A73 从 Ubuntu 集成到 Jenkins - Selenium Integration in Jenkins from Ubuntu using Maven 在Maven中运行硒测试时出现异常 - getting exception while running selenium test in maven 尝试执行自动化脚本(Selenium WebDriver)Maven项目时,在JENKINS中构建失败 - Build failed in JENKINS while trying to execute a automation script (Selenium WebDriver) Maven project Selenium,Maven,Jenkins:更新的/ new测试用例不会通过eclipse运行。 更改仅在运行Jenkins的脚本后出现 - Selenium, Maven, Jenkins: Updated /new test cases do not run through eclipse. The changes only appeared after running the script from Jenkins Jenkins没有显示maven编译器错误 - Jenkins not showing maven compiler errors
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM