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