해결된 질문
작성
·
596
·
수정됨
0
Microsoft Windows [Version 10.0.22621.2861]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Yoon\Desktop\CS\SpringStudy\hello-spring>gradlew build
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'hello-spring'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.1.
Required by:
project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.2.1
> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.2.1 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.5' but:
- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.1 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.5')
- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.1 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.5')
- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.2.1 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.5')
- Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.2.1 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.5')
- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.1 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.5')
- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.2.1 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.5')
* Try:
> 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 5s
안녕하세요 어제 동일한 질문을 올렸었는데 파일의 권한을 수정하고 다시 올렸습니다.
우선 저는 윈도우 사용자이고, java --version으로 확인해봐도 Java 17버전이고, 설정 가능한 모든 부분에서 17버전으로 바꿨는데도 에러가 발생합니다.
모든 방법을 시도해봐도 cmd에서 "gradlew build" 명령어를 치면 build failed라는 메시지가 출력됩니다.
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.1'
id 'io.spring.dependency-management' version '1.1.4'
}
group = 'hello'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}
파일 링크: https://drive.google.com/file/d/1hnY1DJJ-9loR_mcQBum97NDgOErGgoMO/view?usp=sharing
며칠째 이부분에서 막혀서 진도를 못 나가고 있습니다.. 도와주세요..ㅠㅠ
------------------------------------------------------------------------------------------------
java 17버전으로 설정해도 오류가 나시는 분들이 계시다면 아래 방법을 따라해보세요.
저는 이렇게 하니 해결되었습니다.
인텔리제이 최신버전으로 재설치
기존 JDK 삭제 후 최신버전으로 재설치 및 환경변수 등록 (재부팅 필수)
설치한 JDK를 프로젝트에 적용
답변 3
0
안녕하세요, 인프런 AI 인턴입니다.
강의 수강생의 질문 내용을 살펴보니, Gradle 빌드 오류에 대한 해결 방법을 찾고 계십니다. 이와 유사한 문제를 겪고 있는 다른 수강생들을 위한 기존 답변이 있어 링크를 공유드립니다.
제목: cmd gradlew 빌드 오류
링크: cmd gradlew 빌드 오류
이 링크의 내용을 참고하시면 현재 겪고 계신 문제의 해결에 도움이 될 수 있습니다. 해당 답변에서는 Java 버전과 Gradle 설정을 확인하고 조정하는 방법에 대해 설명하고 있습니다.
또한, 사용하고 계신 Java 버전과 프로젝트의 Spring Boot 버전이 서로 호환되는지 확인해보시기 바랍니다. Spring Boot 3.x 버전은 Java 17을 요구하기 때문에, 설정이 올바르게 되어 있는지 다시 한 번 점검해 주세요.
도움이 필요하시면 언제든 질문해 주십시오. 감사합니다.
답변 남겨주신대로 해보아도 똑같습니다 ㅠㅠ