inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

cmd gradlew 빌드 오류

7498

94leehd

작성한 질문수 6

1

오류 문구는 아래와 같습니다.

 

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.0.4.

Required by:

project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.4

> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.4 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.4 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

- Other compatible attribute:

- Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')

- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.4 declares a runtime of a component, 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 '7.6.1')

- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.4 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

- Other compatible attribute:

- Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')

- Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.4 declares a runtime of a library, 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 '7.6.1')

- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.4 declares a runtime of a library, 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 '7.6.1')

- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.4 declares a runtime of a component, 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 '7.6.1')

* 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

 

확인 부탁드립니다.

java spring mvc spring-boot

답변 2

5

임수한

저도 해당 오류가 발생하였는데 저는 ide 실행 시 작동하는 gradle 버전이 낮아서 해당 문제가 발생했던 거여서

혹시 Settings -> Build, Execution, Deployment -> Build Tools -> Gradle 에서 Gradle JVM의 버전이 17이 아니라면 해당 버전으로 바꾸어 보시겠어요? image

1

OMG

안녕하세요. 94leehd님, 공식 서포터즈 OMG입니다.
.

PC에 설치된 자바 버전과 프로젝트 세팅 시 자바 버전을 동일하게 맞춰주세요.

설치한 스프링 부트 프로젝트의 버전은 3.0.4인 것 같습니다.

스프링부트 3.0.4로 진행하실 경우 자바17버전을 고르시고, PC에는 자바 17버전이 설치되어 있어야합니다.

스프링부트 2.7.9로 진행하실 경우 자바11버전을 고르시고, PC에는 자바 11버전이 설치되어 있어야합니다.

image

추가로 설정은 아래를 참고해주세요. 자바 버전을 프로젝트 시 선택한 자바 버전과 PC에 설치된 자바 버전을 통일시켜주세요

https://docs.google.com/document/d/1j0jcJ9EoXMGzwAA2H0b9TOvRtpwlxI5Dtn3sRtuXQas/edit#heading=h.owcsqc19zslv
.
감사합니다.

..

0

77

2

Unused property.....

0

102

2

project JDK is misconfigured

0

132

2

외부 API의 ID 타입(String/UUID)과 내부 도메인의 ID 타입(Long)이 불일치할 때의 설계 정석

0

83

2

단위/통합 테스트 버전충돌 문제

0

91

2

❗️springboot 4.0.2 버전 aspectj dependency 설정❗️

0

230

1

왜 컨트롤러는 변한게 없는데 새로 만든 html 파일이 뜨나요?

0

104

2

윈도우 build test오류 질문

1

103

2

테스트 관련 공부에 대한 조언을 얻고 싶습니다

0

101

2

테스트 실행 시 에러 질문

0

292

1

name을 통한 비교와 객체를 통한 비교

0

77

1

빌드 후 libs 없음

1

130

1

윈도우 gradlew.bat 에러

0

168

1

@PostMapping("/members/new")가 동작하지 않습니다

0

90

1

java static class와 kotlin class

0

79

1

스프링 DB연결

0

127

1

소요 시간

0

87

2

ddl.sql에 빨간 밑줄

1

102

2

welcome page 에러

0

183

3

잘 모르겠습니다.

0

164

2

fail을 똑같이 쳤는데 오류가 발생해요

0

157

2

index.html Welcome page

0

125

1

프로젝트 gradle-groovy ?

0

372

1

테스트코드 메서드명 한글

0

204

2