我无法使用Jenkins maven插件进行模块排除,请参阅下面的输出:
07:11:53 Executing Maven: -B -f /home/jenkins/.jenkins/workspace/my_project/pom.xml clean cobertura:cobertura install -P nogpl,ci -pl -gotham/java/dev-server -X -e
07:12:00 Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
07:12:04 Maven home: /home/jenkins/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/jenkins_maven
07:12:06 Java version: 1.7.0_60, vendor: Oracle Corporation
07:12:06 Java home: /usr/local/java/jdk1.7.0_60/jre
07:12:06 Default locale: en_US, platform encoding: UTF-8
07:12:06 OS name: "linux", version: "3.5.0-23-generic", arch: "amd64", family: "unix"
07:12:06 [INFO] Error stacktraces are turned on.
07:12:06 [DEBUG] Reading global settings from /home/jenkins/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/jenkins_maven/conf/settings.xml
07:12:06 [DEBUG] Reading user settings from /home/jenkins/.m2/settings.xml
07:12:06 [INFO] Scanning for projects...
07:12:06 [ERROR] Could not find the selected project in the reactor: -gotham/java/dev-server -> [Help 1]
当我将命令复制到同一个Job中的预构建shell步骤时,它可以工作:
07:20:27 + mvn -B -f /home/jenkins/.jenkins/workspace/my_project/pom.xml clean cobertura:cobertura deploy -P nogpl,ci -pl -gotham/java/dev-server -X -e
07:20:27 Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
07:20:27 Maven home: /home/jenkins/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/jenkins_maven
07:20:27 Java version: 1.7.0_60, vendor: Oracle Corporation
07:20:27 Java home: /usr/local/java/jdk1.7.0_60/jre
07:20:27 Default locale: en_US, platform encoding: UTF-8
07:20:27 OS name: "linux", version: "3.5.0-23-generic", arch: "amd64", family: "unix"
07:20:30 [INFO] Error stacktraces are turned on.
07:20:30 [DEBUG] Reading global settings from /home/jenkins/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/jenkins_maven/conf/settings.xml
07:20:30 [DEBUG] Reading user settings from /home/jenkins/.m2/settings.xml
07:20:30 [DEBUG] Using local repository at /home/jenkins/.m2/repository
07:20:30 [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/jenkins/.m2/repository
07:20:30 [INFO] Scanning for projects...
[...]
07:20:31 [INFO] ------------------------------------------------------------------------
07:20:31 [INFO] Reactor Build Order:
在堆栈跟踪中,您可以看到hudson-maven代理正在干扰。 值得注意的差异是:
org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard
,shell使用...launchEnhanced
org.apache.maven.DefaultMaven.trimSelectedProjects
失败,但shell在...trimExcludedProjects
完整堆栈跟踪是:
Could not find the selected project in the reactor: -gotham/java/dev-server -> [Help 1]
org.apache.maven.MavenExecutionException: Could not find the selected project in the reactor: !gotham/java/dev-server
at org.apache.maven.DefaultMaven.trimSelectedProjects(DefaultMaven.java:886)
at org.apache.maven.DefaultMaven.createProjectDependencyGraph(DefaultMaven.java:820)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:268)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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:181)
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:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
当我故意尝试在预构建步骤中排除不存在的模块时,将其与故障堆栈跟踪进行比较:
org.apache.maven.MavenExecutionException: Could not find the selected project in the reactor: gotham/java/dev-server2
at org.apache.maven.DefaultMaven.trimExcludedProjects(DefaultMaven.java:977)
at org.apache.maven.DefaultMaven.createProjectDependencyGraph(DefaultMaven.java:821)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:268)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
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:606)
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)
我还尝试使用-pl !gotham/java/dev-server
语法,并尝试不在pl
之后添加空格-pl!gotham/java/dev-server
注意:这些运行之间存在细微差别 - 直接从shell执行的运行是Using local repository at /home/jenkins/.m2/repository
,而通过插件执行的运行不是。{0}。我不确定原因是什么,但我怀疑它是否相关
我使用Jenkins版本1.540和maven-project插件v.2.8(最新)
答案 0 :(得分:2)
显然这确实得不到支持 - {{3p>