인프런 커뮤니티 질문&답변

한양을 위하여님의 프로필 이미지

작성한 질문수

자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]

강의 준비 영상 - 스프링 프로젝트를 시작하는 첫 번째 방법

아직도 시작을 못하고 있어요,,,,,

24.02.23 16:22 작성

·

300

0

다음과 같은 오류가 나와서 어떻게 해야할 지 모르겠네요 따로 건든건 없는데요...

 

A problem occurred configuring root project 'library-app'.

> 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.5' 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.5')

- 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.5')

- 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.5')

- 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.5')

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

- Variant 'sourcesElements' 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.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.

 

답변 2

0

최태현님의 프로필 이미지
최태현
지식공유자

2024. 02. 23. 16:46

안녕하세요! wncks415님! https://www.inflearn.com/questions/1186875/%EC%9E%90%EB%B0%94-%EB%B2%84%EC%A0%BC%EC%9D%B4-%EC%95%88%EB%A7%9E%EB%8A%94%EA%B1%B0%EA%B0%99%EC%9D%80%EB%8D%B0-%EC%96%B4%EB%96%BB%EA%B2%8C-%ED%95%B4%EC%95%BC%ED%95%A0%EC%A7%80-%EB%AA%A8%EB%A5%B4%EA%B2%A0%EB%84%A4%EC%9A%94-%E3%85%9C%E3%85%9C 에서 적어주신 것도 확인해보았습니다.

 

제일 정확한건 build.gradle 파일까지 같이 보면 좋을 것 같은데요! 혹시 강의를 위해 처음 프로젝트를 설정하실 때

image

<완성된 코드>를 선택하셨나요?!!

<처음 시작을 위한 코드>를 고르셔야 자바 11과 잘 호환되어 동작됩니다! 🙂

 

만약 설정을 별도로 건들지 않으시고, <처음 시작을 위한 코드>를 사용하시면 잘 될거에요! 👍

0

인프런 AI 인턴님의 프로필 이미지

2024. 02. 23. 16:27

안녕하세요, 인프런 AI 인턴입니다.

wncks415님, 제공해주신 정보를 바탕으로 해결 방법을 찾아보았습니다.

질문에서 언급된 오류는 스프링 부트 3.0.1 버전과 Java 11 버전의 호환성 문제로 보입니다. 스프링 부트 3.0.1 버전은 Java 17 버전이 필요한데, 현재 프로젝트는 Java 11 버전을 사용하도록 설정되어 있어 발생하는 문제입니다.

이전에 유사한 문제를 겪고 계신 다른 학생의 질문에 대한 답변이 존재합니다. 다음 링크들을 참고하세요:

해결 방법을 요약하자면:

  1. 스프링 부트 버전을 Java 11과 호환되는 버전으로 변경하거나
  2. Java 버전을 17로 업데이트하여 호환되게 만드는 것입니다.

강의를 따라하시다가 문제가 발생하셨다면, 강의 자료 제공 코드가 Java 11과 호환되는 스프링 부트 2.7.x 버전일 가능성이 있습니다. 압축 파일을 제공받았다면, 해당 파일로 프로젝트를 다시 시작해 보시는 것을 권장드립니다.

저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏
추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.