我使用jenkins 2.1运行我的selenium脚本。
当我浏览jenkins时,构建失败。
以下是使用的版本,我尝试更改了许多版本,但它没有成功:
maven编译器-2.4 maven surefire -2.7.1 硒2.44:
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
E:\Jino_testing\Automation_project\Guru99\src\test\java\PageObject\Locators.java:[17,38] error: package com.relevantcodes.extentreports does not exist
E:\Jino_testing\Automation_project\Guru99\src\test\java\PageObject\Locators.java:[19,38] error: package com.relevantcodes.extentreports does not exist
E:\Jino_testing\Automation_project\Guru99\src\test\java\PageObject\Locators.java:[156,2] error: cannot find symbol
symbol: class ExtentReports
location: class Locators
E:\Jino_testing\Automation_project\Guru99\src\test\java\PageObject\Locators.java:[156,25] error: cannot find symbol
symbol: variable ExtentReports
location: class Locators
E:\Jino_testing\Automation_project\Guru99\src\test\java\PageObject\Locators.java:[162,13] error: cannot find symbol
symbol: variable LogStatus
location: class Locators
E:\Jino_testing\Automation_project\Guru99\src\test\java\PageObject\Locators.java:[174,14] error: cannot find symbol
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13 seconds
[INFO] Finished at: Wed Apr 04 11:15:51 IST 2018
[INFO] Final Memory: 23M/57M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving E:\Jino_testing\Automation_project\Guru99\pom.xml to Guru99/Guru99/0.0.1-SNAPSHOT/Guru99-0.0.1-SNAPSHOT.pom
channel stopped
Finished: FAILURE
答案 0 :(得分:0)
我非常怀疑你的pom.xml位于C:\Users\Jino\.jenkins\jobs\Guru\workspace
Workspace有多个项目。您应该查看项目路径,其中可以找到目标pom.xml。就像是。
C:\Users\Jino\.jenkins\jobs\Guru\workspace\<projectName>\pom.xml
答案 1 :(得分:0)
尝试更改maven版本3.3.9
您也可以确认您在jenkins中使用的代码是否在IDE中正常工作(构建),如果是这样,请使用与此处使用的完全相同的maven版本。
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to Channel to Maven [C:\Program Files\Java\jdk1.8.0_151/bin/java, -cp, C:\Users\Jino\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;E:\Jino_testing\Test Automation\Maven\apache-maven-3.5.2\boot\plexus-classworlds-2.5.2.jar;E:\Jino_testing\Test Automation\Maven\apache-maven-3.5.2/conf/logging, jenkins.maven3.agent.Maven33Main, E:\Jino_testing\Test Automation\Maven\apache-maven-3.5.2, C:\Users\Jino\.jenkins\war\WEB-INF\lib\remoting-3.19.jar, C:\Users\Jino\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar, C:\Users\Jino\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar, 58713]
从您的代码中观察到上述错误,当您提到maven-compiler -2.4时,它提到了maven 3.5。