./gradlew build FAIL
389
작성한 질문수 1
프로젝트 생성

프로젝트 Structure

빌드 command 입력시 오류내용
PS C:\Users\82107\spring\demo> ./gradlew build
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'demo'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.3.
Required by:
project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.2.3
> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.2.3 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.6' but:
- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.3 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 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.3 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 8)
- 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.6')
- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.2.3 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 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.2.3 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 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.3 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 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.3 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 8)
- 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.6')
* Try:
> Review the variant matching algorithm at https://docs.gradle.org/8.6/userguide/variant_attributes.html#sec:abm_algorithm.
> No matching variant errors are explained in more detail at https://docs.gradle.org/8.6/userguide/variant_model.html#sub:variant-no-match.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 2s
비슷한 질문들을 확인하였는데, 버전 문제인 것 같긴한데, 현재 JDK18버전을 사용하고 있어서 그런것인가요?
17버전으로 바꾸면 되나요? 만약에 그렇다고 한다면, 설정부분에서 어디어디를 바꿔주어야하나요?
답변 1
0
안녕하세요, 인프런 AI 인턴입니다.
김주한님, 빌드 오류는 프로젝트가 Java 8과 호환되는 라이브러리를 찾도록 설정되어있지만, 실제로는 Java 17과 호환되는 spring-boot-gradle-plugin:3.2.3을 필요로 하고 있기 때문에 발생하고 있습니다.
오류 메시지를 바탕으로 해결 방법을 제안 드리겠습니다.
- 프로젝트를 Java 17로 변경하거나
- spring-boot-gradle-plugin의 버전을 Java 8과 호환되는 버전으로 다운그레이드해야 합니다.
JDK 18을 사용 중이라면, 빌드 스크립트에서 JDK 버전을 17로 명시적으로 설정할 필요가 있습니다. build.gradle 파일과 IDE 설정에서 Java 버전을 JDK 17로 설정해 보세요.
build.gradle 파일에서는 다음과 같이 설정됩니다.
sourceCompatibility = '17'
IDE의 설정에서는 프로젝트의 JDK 버전을 17로 설정해야 합니다.
다음은 참고할 수 있는 관련 정보가 있는 문서와 URL입니다:
- Spring Boot Reference Documentation v3.1.5: Gradle 구성을 위한 기본 설정 (출처 링크)
- Spring Boot Gradle Plugin 요구 사항 (출처 링크)
변경 후 ./gradlew build 명령어를 다시 실행하여 문제가 해결되었는지 확인해 주세요.
내부 객체 직접 접근에 관하여.
0
13
1
CertificationServiceTest
0
24
1
FlushModeType.COMMIT (12:45) 예시코드 질문
0
21
1
클로드코드 명령어 - 대화&세션관리부분 강의자료 빈폴더
0
27
1
Spock given and가 검증을 하는지
0
23
1
9번 강의 save 메서드 질문
0
28
1
readme에 대한 자료는 따로 받아볼수 있나요?
0
38
2
InvalidCurriculumException DIP 적용 여부 문의
0
30
1
섹션2, 대화&세션관리 수업 자료 누락
0
40
2
HelloSpringApplication.java 클래스 실행 오류
0
46
1
build 시 에러 해결방법 공유(docker.desktop 업데이트 -> 의존성 버전 수정)
0
65
2
네이버 API | '검색 - 책' API 제공 중단
0
67
2
Part 2 듣기전 복습하던 중, 아키텍처에 관한 질문이 있습니다.
0
74
2
장치 의존성과 CSR
0
67
1
테스트는 인터페이스를 대상으로 만드는것에 대해 궁금한 점이 있습니다.
0
45
1
[영한님]Spring Boot 및 프로젝트 생성
0
78
2
JPA 엔티티로 만들었다고 기술종속이 아닌지에 대한 질문
0
80
3
강의 요청 문의
0
53
2
클로드코드 명령어-대화&세션관리 수업 자료
0
58
1
콘솔 로그가 깨져나오는데 혹시 방법이 있을까요?
0
77
2
PlatformTransactionManager, ResourcelessTransactionManager 질문
1
85
2
자료 한번에 다운받기
0
50
1
스프링 빈 등록 방법 2가지 다 알아야하는 이유
0
67
1
mybatis 를 이용한 crud에서 insert에서 resultType='long" 이라고 하셨는데요,
0
44
1





