• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

프로젝트 생성 단계, build.gradle 오픈시 오류

22.12.29 23:58 작성 22.12.30 00:34 수정 조회수 15.7k

0

build.gradle를 오픈하자마자 다음과 같은 오류가 뜹니다ㅜㅜ

 

자바는 11버전 설치했고 강의 제일 처음, build.gradle부터 오픈하자마자 저런 오류가 났고 아무것도 안건들었습니다.

<오류코드>- 일부만 가져왔습니다.

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

Required by:

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

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

- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 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')

- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 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')

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

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

답변을 작성해보세요.

3

OMG님의 프로필

OMG

2022.12.30

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

스프링부트 3.x로 생성하신 것 같습니다.

스프링부트3.x 는 자바17부터, 스프링부트 2.x는 자바11을 이용해주세요.

강의 제작 시점과 차이나는 문제(ex)스프링부트 버전) 는 메뉴얼에 작성되어 있으니 참고하여 수강 하시면 됩니다.
.
감사합니다.

ks님의 프로필

ks

질문자

2023.01.01

감사합니다 스프링부트 3.x 버전을 설치해서 그런거네요.. 2.7.x 버전으로 수정하니깐 제대로 실행되네요!! 감사합니다ㅎㅎimage하나만 더 여쭤봐도 될까요? 이렇게 build.gradle에 들어가서 스프링부트 버전을 원래 3.0.1 버전에서 제가 2.7.6으로 바꿨는데 상관없나요? spring.io에 들어가서 버전 수정한 것이 아닌 build.gradle 파일 내에서 수정했습니다. 그래도 오류는 안나고 제대로 되긴합니다!

OMG님의 프로필

OMG

2023.01.01

네 정상 실행된다면 그렇게해도 괜찮습니다

문영훈님의 프로필

문영훈

2023.05.16

혹시 스트링부트 3.x 자바17로 다운받았는데 같은 에러코드가 나오는이유는 무엇일까요..

OMG님의 프로필

OMG

2023.05.16

어떤 오류메시지가 발생하는지 캡쳐본과 함께 새로운 글을 작성하여 남겨주세요 ^^