简体   繁体   中英

Cannot execute a simple maven project through jenkins

I'm using Linux - Ubuntu 14.04. I've installed Jenkins 2.7.2.

I created a maven project in Eclipse and followed the instructions provided in this link http://www.guru99.com/maven-jenkins-with-selenium-complete-tutorial.html .

After completing the project setup, I executed it as Maven Project and the build was successful.

Then I installed Jenkins, installed Maven Integration Plugin, created a Maven Project and added the Root POM location and in 'Goals and options' field, I gave 'test' as input and executed the Build, but the Build was a failure.

The console output is as follows:

Started by user QA Admin
Building in workspace /var/lib/jenkins/workspace/WebDriverTest2
Parsing POMs
Established TCP socket on 58065
[WebdriverTest] $ java -Xms1024m -Xmx4096m -XX:PermSize=1024m -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.7.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.60.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-interceptor-1.7.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.7.jar 58065
 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /home/admin/workspace/WebdriverTest/pom.xml test
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building WebdriverTest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ WebdriverTest ---
[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.5.1:compile (default-compile) @ WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ WebdriverTest ---
[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.5.1:testCompile (default-testCompile) @ WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ WebdriverTest ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[JENKINS] Recording test results
hudson.AbortException: Test reports were found but none of them are new. Did tests run? 
For example, /home/admin/workspace/WebdriverTest/target/surefire-reports/TEST-TestSuite.xml is 23 min old

    at hudson.tasks.junit.TestResult.parse(TestResult.java:228)
    at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148)
    at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:634)
    at hudson.maven.Maven3Builder$MavenExecutionListener.mojoFailed(Maven3Builder.java:667)
    at hudson.maven.Maven3Builder$JenkinsEventSpy.onEvent(Maven3Builder.java:311)
    at org.apache.maven.eventspy.internal.EventSpyDispatcher.onEvent(EventSpyDispatcher.java:104)
    at org.apache.maven.eventspy.internal.EventSpyExecutionListener.mojoFailed(EventSpyExecutionListener.java:138)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:90)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:219)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
    at hudson.remoting.UserRequest.perform(UserRequest.java:153)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:332)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.097 s
[INFO] Finished at: 2016-08-25T17:16:17+05:30
[INFO] Final Memory: 18M/981M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project WebdriverTest: Error creating properties files for forking: No such file or directory -> [Help 1]
[JENKINS] Archiving /home/admin/workspace/WebdriverTest/pom.xml to WebdriverTest/WebdriverTest/0.0.1-SNAPSHOT/WebdriverTest-0.0.1-SNAPSHOT.pom
[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/MojoFailureException
/home/admin/workspace/WebdriverTest/pom.xml is not inside /var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest/; will archive in a separate pass
channel stopped
Finished: FAILURE

Any help is greatly appreciated. Please help. Thanks in advance.

It looks like you may have given an absolute path to the pom file. At the top Maven logs

Building in workspace /var/lib/jenkins/workspace/WebDriverTest2

And at the end you can see

/home/admin/workspace/WebdriverTest/pom.xml is not inside /var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest/; will archive in a separate pass

So if what I'm thinking is correct, you just need to change the "Root POM" parameter. Give it a relative path to the pom.xml from the project's root directory. So if your project is

WebDriverTest src/main/java src/test/java ... pom.xml

The "Root POM" parameter should just be pom.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM