스프링부트 3 버전을 사용하면서 이전 프로젝트를 실행시키는데 아래와 같은 에러가 발생했다.
Required by: project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.2.0 Caused by: org.gradle.internal.component.NoMatchingGraphVariantsException: No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.2.0 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.5' but: - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.0 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11
즉 런타임에서 자바11과 호환되는 라이브러리를 찾는다는 내용인데 yml에도 17을 사용하도록 명시해놨는데
문제는 다른 곳에서 해결할 수 있었다.
설정에서 Gradle 부분에 JVM 버전이 11로 설정돼있었다.
Gradle을 실행할 때 지금은 9.0에 스프링부트 3.x 버전인데 자바 JDK를 11로 해놓으니 문제가 발생한 것
이걸 17로 바꿔주니 정상 빌드가 됐다!
'오류해결' 카테고리의 다른 글
스프링 시큐리티 6.1부터 csrf().disable() 불가능 문제 (0) | 2023.12.22 |
---|---|
젠킨스 파이프라인 문법 에러 (1) | 2023.12.17 |
CHAT GPT API 사용량 초과 에러 (2) | 2023.08.30 |
생성자 주입을 하면서 생겼던 문제(Null) (0) | 2023.07.23 |