Jenkins在ubuntu 16.04上为maven测试项目构建错误

时间:2017-12-01 10:55:46

标签: maven ubuntu jenkins

我在Ubuntu 16.04上运行maven测试项目时遇到了以下错误。当我从终端运行项目时它工作正常。但我现在需要通过Jenkins运行它。 我已经为jenkins用户授予了所有权限。我似乎无法理解此错误的原因,以便我可以进一步排除故障。有人可以帮助我,因为我是Devops和学习的新手吗?

控制台输出

`EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/Maven Test Parsing POMs                      Established TCP socket on 43944 [IceScrum] $ /usr/lib/jvm/java-8-oracle    //bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-agent-1.12-alpha-1.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar:/usr/share/maven/conf/logging jenkins.maven3.agent.Maven33Main /usr/share/maven/ /var/cache/jenkins/war/WEB-INF/lib/remoting-3.10.2.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-interceptor-1.12-alpha-1.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12-alpha-1.jar 43944 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven:  -B -f /opt/IceScrum/pom.xml verify [INFO] Scanning for projects...`

`[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2 [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cxm7 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/IceScrum/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ cxm7 --- [INFO] No sources to compile [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cxm7 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/IceScrum/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ cxm7 --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.17:test (default-test) @ cxm7 --- [INFO] No tests to run.
[INFO] Surefire report directory: /opt/IceScrum/target/surefire-reports`

`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project cxm7: Error creating properties files for forking: 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.
[JENKINS] Archiving /opt/IceScrum/pom.xml to cxm/cxm7/0.0.1-SNAPSHOT/cxm7-0.0.1-SNAPSHOT.pom
/opt/IceScrum/pom.xml is not inside /var/lib/jenkins/workspace/Maven Test/opt/IceScrum/; will archive in a separate pass [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
channel stopped
Finished: FAILURE`

用-X开关运行脚本后。我得到了以下结果。

Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_151, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: en_IN, platform encoding: UTF-8 OS name: "linux", version: "4.4.0-101-generic", arch: "amd64", family: "unix" [DEBUG] Populating class realm maven.api [INFO] Error stacktraces are turned on.[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml [DEBUG] Reading user settings from /root/.m2/settings.xml [DEBUG] Reading global toolchains from /usr/share/maven/conf/toolchains.xml[DEBUG] Reading user toolchains from /root/.m2/toolchains.xml [DEBUG] Using local repository at /root/.m2/repository [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /root/.m2/repository [INFO] Scanning for projects [DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none) [DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null] [INFO]``[INFO] BUILD FAILURE``[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/cyberadmin). Please verify you invoked Maven from the correct directory. -> [Help 1]org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/home/cyberadmin). Please verify you invoked Maven from the correct directory. at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:84) 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.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 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.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [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/MissingProjectException

0 个答案:

没有答案