반응형
intellij로 spring 프로젝트를 신규 생성했는데 빌드가 실패하는 상황이 발생했습니다.
해당 프로젝트 버전은 하기와 같았습니다.
version
- spring-boot - 3.1.4
- java - 17
해당 에러
A problem occurred configuring root project 'token-bucket'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.4.
Required by:
project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.1.4
> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.4 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.3' but:
- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 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
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 11)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.4 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
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
- Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.4 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 11)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
...
....
원인
콘솔에 찍힌 에러를 번역하여 분석해보니 spring-boot 3.1.4의 호환성 문제였습니다. 이전 프로젝트 진행하며 gradle version과 java sdk version을 17 -> 11로 다운그레이드 한게 원인이었습니다.
Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
해결방법
java version을 11 -> 17로 변경하면 됩니다. local java version은 건들지 않고, intellij에서 build시에만 반영토록 version을 변경합니
다.
Settings(command +) -> Build, Execution, Deployment > Gradle > Gradle JVM 변경

번외
프로젝트의 호환성 문제가 아닌 순수하게 gradle의 호환성 문제이면 알맞는 java version을 맞춰주면 됩니다.

반응형
'트러블슈팅 & 삽질기록' 카테고리의 다른 글
| Apache HTTPD 버전 업그레이드 중 MPM 이슈와 해결 과정 (5) | 2025.07.20 |
|---|---|
| Spring Boot 3.4.3에서 Auto-configuration이 동작하지 않는 문제 해결 (0) | 2025.03.09 |
| IntelliJ 특정 버전 JDK 21 사용 시 컴파일 오류 (2) | 2025.02.22 |
| [mac] 문제가 발생했기 때문에 컴퓨터를 종료했습니다. 경고창 뜨는 경우 대처법 (2) | 2023.09.07 |
| @PathVariable로 인한 이슈 (1) | 2022.05.01 |