Spring Boot
[Spring Boot] 빌드 실패 (Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.3.)
DEV_HEO
2024. 3. 12. 23:15
320x100
* What went wrong:
A problem occurred configuring root project 'GooJob'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.3.
Required by:
project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.2.3
> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.2.3 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, 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.3 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 11
- 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.3 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 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 '8.5')
- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.2.3 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 11
- 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.3 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 11
- 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.3 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 11
- 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.3 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 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 '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 7s
빌드하는데 위와 같은 오류가 발생했다.
프로젝트는 java8로 되어있는데 스프링부트 3.2.3 버전의 경우 17버전을 권장하기 때문이라고 한다.
스프링부트는 3.0 부터 Java 17을 지원한다. 따라서 기존 Java8, 11 등을 사용한다면 에러를 만나게 된다.
Spring Boot 사이트에도 17버전을 권장한다고 적혀있다.
https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html
JAVA 버전 확인
프로젝트 우클릭 - properties 에서 jre 버전을 확인해보니 17로 되어있다.
다시 검색해보니
컴퓨터에 설치된 자바 버전을 확인해보라고 한다.
11버전이므로 아래 사이트를 참고해서 17버전을 깔아준다.
https://coding-factory.tistory.com/823#google_vignette
[Java] 자바 버전 변경하는 방법 ( JDK 8 -> JDK 17)
자바 언어로 개발하는 프로젝트에서 협업을 해야 할 상황이 있다면 개발자들끼리 JDK 버전을 맞춰주셔야 합니다. JDK 버전이 다르면 컴파일의 최적화 과정에서 서로 .class파일이 다르게 생성될 수
coding-factory.tistory.com
17버전을 다시 깔아주고 """"다시 시작""""을 해야 빌드성공된걸 확인할수있다.
320x100