2016-08-25 4 views
0

저는 Linux - Ubuntu 14.04를 사용하고 있습니다. Jenkins 2.7.2를 설치했습니다.jenkins를 통해 간단한 maven 프로젝트를 실행할 수 없습니다.

Eclipse에서 maven 프로젝트를 만들고이 링크 http://www.guru99.com/maven-jenkins-with-selenium-complete-tutorial.html의 지침을 따랐습니다.

프로젝트 설정을 완료 한 후 Maven 프로젝트로 실행 했으므로 빌드가 성공적으로 완료되었습니다.

젠킨스를 설치하고 Maven 통합 플러그인을 설치하고 Maven 프로젝트를 만들고 루트 POM 위치를 추가 한 다음 '목표 및 옵션'입력란에 '테스트'를 입력하고 빌드를 실행했지만 빌드는 실패.

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 

어떤 도움이 크게 감사합니다 다음과 같이

콘솔 출력입니다. 도와주세요. 미리 감사드립니다.

답변

0

pom 파일의 절대 경로를 지정했을 수 있습니다. 상단 메이븐 로그

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

그리고 마지막에

에서 당신은

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

를 볼 수 있도록 올바른 내가 무엇을 생각하고, 그냥 "루트 POM"을 변경해야하는 경우 매개 변수. 프로젝트의 루트 디렉토리에서 pom.xml에 대한 상대 경로를 지정하십시오. 프로젝트 인 경우

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

그래서 "루트 POM"매개 변수는

+0

pom.xml 당신의 응답을 주셔서 감사해야합니다. 이것이 내 루트 POM 경로 "/home/admin/workspace/WebdriverTest/pom.xml"입니다. 나는 Jenkins config에 이것을 추가했습니다. –

+0

WebdriverTest/pom.xml 만 유지하려고 시도합니다. – Tim

+0

존재하지 않는/var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest /에서 POM을 찾고 있습니다. 나는 Jenkins를 지속적인 통합 환경에서 운영하는 데 익숙해 져 있기 때문에 상황이 다를 수 있습니다. 작업 공간을/home/admin/workspace/WebdriverTest/ – gregbert

관련 문제