본문 바로가기

트러블슈팅

Jenkins에서 SonarQube Execution Failure

문제

Jenkins에서 CI를 하는데 아래와 같은 Execution Failrue가 났다.

ERROR: Error during SonarQube Scanner execution
ERROR: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), 
this version of the Java Runtime only recognizes class file versions up to 52.0

 

에러 메세지를 보아선 SonarQube Scanner exceution을 하는 동안, JAVA 버전으로 인해 에러가 발생한 거 같다.

Java는 1.8.0_181 Oracle 버전을 사용하고 있었고, 이 Java Runtime으로는 52.0까지만 지원 가능하다고 한다.

현재 SonarQube Scanner는 55.0 버전을 사용해서, 좀 더 최신의 Java Runtime 버전을 사용하라고 한다.

원인

인터넷을 검색해보니 많은 사람들이 겪은 에러였던 거 같다. JAVA 11로 올리니 문제가 해결되었다고 한다.

즉, SonarQube Scanner 55.0버전은 JAVA 1.8을 지원하지 않아서 생긴 문제이다.

 

https://stackoverflow.com/questions/68296776/how-to-fix-sonar-plugin-issue-in-jenkins

 

How to fix sonar plugin issue in jenkins

How to avoid issue with sonar scanner plugin on Jenkins 2.289.2, plugin sonar 2.13.1 when compiling a project I got the error [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-

stackoverflow.com

해결

프로젝트 내 pom.xml에서 Sonar 관련 설정에 sonar.java.source를 11로 변경해주었다.

 

Jenkins의 Configure에서 Execution SonarQube Scanner도 JDK 11을 사용하도록 수정해주었다.

 

변경 후 다시 CI를 돌리니 해결된 것을 확인했다.