IT/서버

jenkins 에서 여러 jdk 중에 하나 골라서 빌드하게 지정

thesse 2023. 5. 24. 11:09
300x250
반응형
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'thesseSpring'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.6.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.6
      > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.6 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.6.1' but:
          - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11

 

spring boot 3으로 올리고 이것저것 터지는게 많다...

 

이번에는 젠킨스 문제인데

spring boot 3은 최소 자바 17 버전으로 돌려야 한다.

그런데 기존 젠킨스는 자바 11 버전으로 돌아가고 있었다.

 

프로젝트 하나만 한다면 jenkins 서버 자체의 jdk를 바꾸면 되지만

기존에 jdk 11로 돌아가던 프로젝트들이 여전히 있기 때문에

프로젝트별로 사용할 jdk를 특정해줘야 한다.

 

 

 

여기로 들어가서

 

 

 

Add JDK 해준다.

JAVA_HOME은 젠킨스 서버에 넣어둔 jdk 파일 위치

 

 

 

 

그러고 프로젝트의 Config 화면에서 보면 JDK 선택하는 드롭다운이 생겨있다!

 

 

300x250
반응형