Jenkins incapable de courir Maven

J'ai suivi ce tutoriel pour installer Jenkins avec GIT et Maven (avec de légères modifications car j'utilise Linux CenOS).

J'essaie de tester ma configuration sur un projet Demo Maven de GitHub

Jenkins jette une exception en essayant d'exécuter Maven. J'ai donc essayé de cloner le projet et de lancer manuellement Maven, ça marche très bien.

Donc, le problème est avec Jenkins exécutant Maven. J'ai essayé de chercher google pour le problème mais n'ai pu find aucune information utile.

Mes soupçons actuels sont:

  1. Peut-être que Jenkins n'utilise pas le bon path de class pour exécuter Maven. Cela peut être dû à l'absence de permission de lire des files, puisque Jenkins a son propre user sur linux (nommé jenkins).
  2. Peut-être que Maven n'est pas installé correctement. Je l'ai installé manuellement, plutôt que de laisser Jenkins l'installer pour moi, car j'ai besoin de cette configuration pour fonctionner hors ligne.

Voici la sortie de la console de Jenkins:

Started by an SCM change Building in workspace /var/lib/jenkins/jobs/Omri/workspace Checkout:workspace / /var/lib/jenkins/jobs/Omri/workspace - hudson.remoting.LocalChannel@7ff79fae Using strategy: Default Last Built Revision: Revision af62f13d2374bc00a4b67f7586bfd52b7bda80eb (origin/prepare) Fetching changes from 1 remote Git repository Fetching upstream changes from origin Seen branch in repository origin/HEAD Seen branch in repository origin/master Seen branch in repository origin/prepare Seen 3 remote twigs Commencing build of Revision a9a1fc4a96d4ac4af3ca5e7e3b7393a6df4bf555 (origin/HEAD, origin/master) Checking out Revision a9a1fc4a96d4ac4af3ca5e7e3b7393a6df4bf555 (origin/HEAD, origin/master) No change to record in branch origin/HEAD No change to record in branch origin/master Parsing POMs Modules changed, recalculating dependency graph [workspace] $ /usr/java/jdk1.7.0_17/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.3.jar:/home/jenkins/maven/boot/plexus-classworlds-2.4.2.jar org.jvnet.hudson.maven3.agent.Maven3Main /home/jenkins/maven/ /var/cache/jenkins/war/WEB-INF/lib/remoting-2.24.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.3.jar 53953 <===[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 /var/lib/jenkins/jobs/Omri/workspace/pom.xml -Dmaven.repo.local=/var/lib/jenkins/maven-repositories/1 package 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:331) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:174) 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:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) 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.loadClass(ClassRealm.java:244) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) ... 19 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:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 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:177) 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:331) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:174) ... 11 more 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.loadClass(ClassRealm.java:244) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) ... 19 more Finished: FAILURE 

Des idées quelqu'un? Merci.

Solutions Collecting From Web of "Jenkins incapable de courir Maven"

Apparemment, le problème était que j'ai installé la dernière version alpha de Maven, qui est instable. Avec la dernière version stable – 3.0.5 – tout fonctionne bien.

C'est ici:

 Caused by: java.lang.NoClassDefFoundError: org/apache/maven/cli/MavenLoggerManager at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:73) ... 18 more 

Si vous ne laissez pas Jenkins installer Maven, vous devez configurer l'location de l'installation Maven à utiliser.