인프런 커뮤니티 질문&답변

buo642g님의 프로필 이미지
buo642g

작성한 질문수

Jenkins를 이용한 CI/CD Pipeline 구축

Jenkins를 이용하여 Tomcat 서버에 배포 오류

해결된 질문

작성

·

1.2K

1

Started by user Administrator
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/my-maven-project
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/my-maven-project/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/ryuu9505/demo202212260058 # timeout=10
Fetching upstream changes from https://github.com/ryuu9505/demo202212260058
 > git --version # timeout=10
 > git --version # 'git version 2.38.1'
 > git fetch --tags --force --progress -- https://github.com/ryuu9505/demo202212260058 +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/main^{commit} # timeout=10
Checking out Revision aacd3c84d395746ee5fcf35648855f792cb53577 (refs/remotes/origin/main)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f aacd3c84d395746ee5fcf35648855f792cb53577 # timeout=10
Commit message: "test"
 > git rev-list --no-walk aacd3c84d395746ee5fcf35648855f792cb53577 # timeout=10
Parsing POMs
Established TCP socket on 35511
[my-maven-project] $ java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.14.jar:/opt/maven/boot/plexus-classworlds-2.6.0.jar:/opt/maven/conf/logging jenkins.maven3.agent.Maven35Main /opt/maven /var/lib/jenkins/%C/jenkins/war/WEB-INF/lib/remoting-3071.v7e9b_0dc08466.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.14.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.14.jar 35511
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /var/lib/jenkins/workspace/my-maven-project/pom.xml clean compile package
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:179)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:377)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NoSuchMethodError: 'java.util.List org.apache.maven.eventspy.internal.EventSpyDispatcher.getEventSpies()'
	at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:122)
	... 21 more
ERROR: Failed to parse POMs
java.io.IOException: java.lang.reflect.InvocationTargetException
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:177)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:377)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to Channel to Maven [java, -cp, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.14.jar:/opt/maven/boot/plexus-classworlds-2.6.0.jar:/opt/maven/conf/logging, jenkins.maven3.agent.Maven35Main, /opt/maven, /var/lib/jenkins/%C/jenkins/war/WEB-INF/lib/remoting-3071.v7e9b_0dc08466.jar, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.14.jar, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.14.jar, 35511]
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
		at hudson.remoting.Channel.call(Channel.java:1000)
		at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161)
		at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:877)
		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
		at hudson.model.Run.execute(Run.java:1900)
		at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
		at hudson.model.ResourceController.execute(ResourceController.java:107)
		at hudson.model.Executor.run(Executor.java:449)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
	... 9 more
Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
	at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:182)
	... 14 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:179)
	... 14 more
Caused by: java.lang.NoSuchMethodError: 'java.util.List org.apache.maven.eventspy.internal.EventSpyDispatcher.getEventSpies()'
	at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:122)
	... 21 more
channel stopped
[DeployPublisher][INFO] Build failed, project not deployed
Finished: FAILURE

 

실습24) Jenkins를 이용하여 Tomcat 서버에 배포하기 강에 대한 질문입니다.

강의를 따라 젠킨스 아이템을 만들어 빌드하고 실패하였는데 위 오류로 무엇이 문제인지 짐작이 가지않아 질문 남깁니다.

답변 1

1

Dowon Lee님의 프로필 이미지
Dowon Lee
지식공유자

안녕하세요, 이도원입니다.

해당 오류에 대한 정확한 원인을 알기는 어렵지만, Maver의 버전을 확인해 보는 것과 pom.xml 파일에 오류가 있는지 확인해 보시는 게 필요할 것 같습니다. 중간 오류 내용을 보면 pom 파일에 대한 parsing에 오류가 발생한 내용도 보여서, 사용하신 pom.xml 파일에 이상이 없는지, Local 환경에서 먼저 빌드 후 진행해 보시고, jenkins 서버로 이동 해서 (Docker로 기동 하였을 경우, docker exec 명령어 사용) workspace에서 해당 프로젝트에서 git pull 후에 직접 메이븐 빌드를 수작업으로 해 보시기 바랍니다. Jenkins에서 하는 과정은 자동화 되어 있는 부분이 많기 때문에, 정확한 원인을 수작업으로 디버깅 하듯이 확인해 보는 게 필요할 수 있습니다.

감사합니다.

buo642g님의 프로필 이미지
buo642g

작성한 질문수

질문하기