Legacy Maven 2 job type Plugin with Maven 3.2.1 not working

ⅰ亾dé卋堺 提交于 2019-12-24 01:02:37

问题


I try to use Hudson (3.3.3) and Legacy Maven 2 job type Plugin (3.0.2) with Maven (3.2.1), but I get an error. Is there a way to use Maven 3.2.1?

Job log:

Found mavenVersion 3.2.1 from file jar:file:/C:/Users/dur/.hudson/tools/Maven_3.2.1/lib/maven-core-3.2.1.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
Parsing POMs
[workspace] $ "C:\Program Files\Java\jdk1.7.0_25/bin/java" -cp C:\Users\dur\.hudson\plugins\maven-plugin\WEB-INF\lib\maven3-agent-3.0.2.jar;C:\Users\dur\.hudson\tools\Maven_3.2.1\boot\plexus-classworlds-2.5.1.jar org.jvnet.hudson.maven3.agent.Maven3Main C:\Users\dur\.hudson\tools\Maven_3.2.1 C:\Users\dur\.hudson\war\webapp\WEB-INF\lib\hudson-remoting-3.0.3.jar C:\Users\dur\.hudson\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-3.0.2.jar 61659
<===[HUDSON REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f C:\Users\dur\.hudson\jobs\Test\workspace\pom.xml clean install -P Hudson
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:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:146)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:124)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
    at hudson.remoting.UserRequest.perform(UserRequest.java:107)
    at hudson.remoting.UserRequest.perform(UserRequest.java:41)
    at hudson.remoting.Request$2.run(Request.java:276)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    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:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/cli/MavenLoggerManager
    at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:73)
    ... 18 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.cli.MavenLoggerManager
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
    ... 19 more
channel stopped

I found following questions:

  • Eclipse Community Forums
  • GitHub
  • User list for the Hudson continuous build server

but with no working answer.


回答1:


I found a work-around with Hudson (3.3.3) free-style project and Maven 3 Build Plugin (3.0.5):

  1. Maven 3 Build Plugin configuration (see Hudson Book):

  2. Build Step configuration (see Hudson Book):



来源:https://stackoverflow.com/questions/35454408/legacy-maven-2-job-type-plugin-with-maven-3-2-1-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!