Impossible de déclencher une construction réussie avec Jenkin.
Jenkin Version : 2.46.1
Maven Version :3.5.0
Java version : jdk1.7.0_67
J'ai créé un projet simple en Java sur Maven. Maintenant, quand j’intègre ceci avec Jenkin et que je clique sur la construction maintenant.
La construction est échouée et quelques exceptions se sont produites.
Java.lang.reflect.InvocationTargetException
J'ai joint le détail des journaux.
Détail du journal:
Started by user sougata das Building in workspace C:\Users\sougatadas\workspace\TestNGTutorial Parsing POMs Established TCP socket on 50831 [TestNGTutorial] $ "C:\Program Files\Java\jdk1.7.0_67/bin/Java" -cp "C:\Users\sougatadas\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;F:\Apache-maven-3.5.0-bin\Apache-maven-3.5.0\boot\plexus-classworlds-2.5.2.jar;F:\Apache-maven-3.5.0-bin\Apache-maven-3.5.0/conf/logging" jenkins.maven3.agent.Maven33Main
F:\Apache-maven-3.5.0-bin\Apache-maven-3.5.0 "C:\Users\sougata
das\.jenkins\war\WEB-INF\lib\remoting-3.7.jar" "C:\Users\sougata
das\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar"
"C:\Users\sougata
das\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar"
50831 <===[JENKINS REMOTING CAPACITY]===>channel started Executing
Maven: -B -f C:\Users\sougata das\workspace\TestNGTutorial\pom.xml
install 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 jenkins.maven3.agent.Maven33Main.launch(Maven33Main.Java:176)
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:139) at
hudson.maven.Maven3Builder.call(Maven3Builder.Java:70) at
hudson.remoting.UserRequest.perform(UserRequest.Java:153) at
hudson.remoting.UserRequest.perform(UserRequest.Java:50) at
hudson.remoting.Request$2.run(Request.Java:336) at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.Java:68)
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) Caused by:
Java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE at
org.Apache.maven.cli.DefaultMavenExecutionRequestBuilder.settings(DefaultMavenExecutionRequestBuilder.Java:658)
at
org.Apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.Java:149)
at
org.jvnet.hudson.maven3.launcher.Maven33Launcher.getMavenExecutionRequest(Maven33Launcher.Java:150)
at
org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.Java:127)
... 21 more ERROR: Failed to parse POMs Java.io.IOException:
Java.lang.reflect.InvocationTargetException at
hudson.maven.Maven3Builder.call(Maven3Builder.Java:179) at
hudson.maven.Maven3Builder.call(Maven3Builder.Java:70) at
hudson.remoting.UserRequest.perform(UserRequest.Java:153) at
hudson.remoting.UserRequest.perform(UserRequest.Java:50) at
hudson.remoting.Request$2.run(Request.Java:336) at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.Java:68)
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) at ......remote call to
Channel to Maven [C:\Program Files\Java\jdk1.7.0_67/bin/Java, -cp,
C:\Users\sougata
das\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;F:\Apache-maven-3.5.0-bin\Apache-maven-3.5.0\boot\plexus-classworlds-2.5.2.jar;F:\Apache-maven-3.5.0-bin\Apache-maven-3.5.0/conf/logging, jenkins.maven3.agent.Maven33Main,
F:\Apache-maven-3.5.0-bin\Apache-maven-3.5.0, C:\Users\sougata
das\.jenkins\war\WEB-INF\lib\remoting-3.7.jar, C:\Users\sougata
das\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar,
C:\Users\sougata
das\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar,
50831](Native Method) at
hudson.remoting.Channel.attachCallSiteStackTrace(Channel.Java:1545)
at hudson.remoting.UserResponse.retrieve(UserRequest.Java:253) at
hudson.remoting.Channel.call(Channel.Java:830) at
hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.Java:161)
at
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.Java:873)
at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.Java:534)
at hudson.model.Run.execute(Run.Java:1728) at
hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.Java:544)
at
hudson.model.ResourceController.execute(ResourceController.Java:98)
at hudson.model.Executor.run(Executor.Java:405) 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:606) at
hudson.maven.Maven3Builder.call(Maven3Builder.Java:139) at
hudson.maven.Maven3Builder.call(Maven3Builder.Java:70) at
hudson.remoting.UserRequest.perform(UserRequest.Java:153) at
hudson.remoting.UserRequest.perform(UserRequest.Java:50) at
hudson.remoting.Request$2.run(Request.Java:336) at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.Java:68)
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) Caused by:
Java.lang.Exception: Java.lang.reflect.InvocationTargetException at
jenkins.maven3.agent.Maven33Main.launch(Maven33Main.Java:179) ...
14 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: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.Maven33Main.launch(Maven33Main.Java:176)
... 14 more Caused by: Java.lang.NoSuchFieldError:
DEFAULT_USER_SETTINGS_FILE at
org.Apache.maven.cli.DefaultMavenExecutionRequestBuilder.settings(DefaultMavenExecutionRequestBuilder.Java:658)
at
org.Apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.Java:149)
at
org.jvnet.hudson.maven3.launcher.Maven33Launcher.getMavenExecutionRequest(Maven33Launcher.Java:150)
at
org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.Java:127)
... 21 more channel stopped Finished: FAILURE
Le message d'erreur Caused by: Java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE
est suivi du problème JENKINS-43446 , corrigé dans plug-in Jenkins Maven , Version 2.16 (8 juin 2017) .
Ce ticket comprend le commentaire suivant:
Je devais simplement spécifier un fichier de paramètres utilisateur et global dans la partie "Avancé" de la section "Création". Si je laissais l'un de ces paramètres dans la configuration par défaut, j'obtiendrais ces erreurs.
Comme souligné par mirabilos dans les commentaires et détaillé par Wouter C 's réponse :
Ma solution était de définir le changement de la configuration de construction:
Dans
Configure > Build > Advanced
:
- Définissez
Settings file
surSettings file in filesystem
et entrez le chemin d'accès à votre fichier de paramètres. Dans mon cas:/root/.m2/settings.xml
- Définissez
Global Settings file
surGlobal settings file on filesystem
et entrez le chemin d'accès à votre fichier de paramètres globaux.
Je n'en ai pas (je pense) donc je viens de le régler sur/root/.m2/settings.xml
également.
Essayez d’utiliser une version 3.3.9 de Maven sur Jenkins.
Voir le bug https://issues.jenkins-ci.org/browse/JENKINS-43446
J'ai la version 2.60.3 de Jenkins. Je voulais utiliser Maven 3.5.0 et j'ai l'erreur exacte.
Ma solution consistait à mettre à niveau Maven Integration Plugin en 3.1.2.