2

我在 Jenkins 有一份 Maven 工作。它可以运行“全新安装”,但不能运行简单的“--version”。它实际上确实从“mvn --version”输出了所有信息,但随后以“java.lang.reflect.InvocationTargetException”失败。

任何人都知道为什么这会失败?

日志输出:

[workspace] $ java -cp /home/gerrit/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/home/gerrit/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /home/gerrit/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4 /home/gerrit/.jenkins/war/WEB-INF/lib/remoting-2.23.jar /home/gerrit/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar 56672
<===[JENKINS REMOTING CAPACITY]===>channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven:  -B -f /home/gerrit/.jenkins/jobs/<project>/workspace/pom.xml --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /home/gerrit/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4
Java version: 1.7.0, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.7.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-5-xen-amd64", arch: "amd64", family: "unix"
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.cli.MavenExecutionRequestsBuilderException
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:148)
    at org.jvnet.hudson.maven3.launcher.Maven3Launcher.getMavenExecutionRequest(Maven3Launcher.java:94)
    at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:77)
    ... 18 more
Caused by: org.apache.maven.cli.MavenCli$ExitException
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.cli(DefaultMavenExecutionRequestBuilder.java:238)
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:120)
    ... 20 more
channel stopped
ERROR: Failed to parse POMs
hudson.util.IOException2: java.lang.reflect.InvocationTargetException
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:162)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:161)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
    ... 10 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
    ... 11 more
Caused by: org.apache.maven.cli.MavenExecutionRequestsBuilderException
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:148)
    at org.jvnet.hudson.maven3.launcher.Maven3Launcher.getMavenExecutionRequest(Maven3Launcher.java:94)
    at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:77)
    ... 18 more
Caused by: org.apache.maven.cli.MavenCli$ExitException
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.cli(DefaultMavenExecutionRequestBuilder.java:238)
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:120)
    ... 20 more
Build does not meet criteria for workspace archiving - result is not at least SUCCESS.
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE
4

2 回答 2

1

这似乎是詹金斯的一个错误,我在他们的错误跟踪器中提出了一张票: https ://issues.jenkins-ci.org/browse/JENKINS-21753

同时,我发现唯一可行的解​​决方法是改用 Maven 2。

于 2014-02-11T10:32:44.507 回答
0

我遇到了这个错误。我使用 git。我将 Git 存储库指定到项目的根目录(http://user@github.com/project.git/PROJECT)并获得了良好的构建。在我使用http://user@github.com/project.git之前 和使用 maven 3.0.4 时 Build 是好的

于 2013-07-18T13:04:36.993 回答