본문 바로가기
IDE/Eclipse

[Eclipse] No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.1 was found. 에러 해결 방법

by 광진구뚝배기 2023. 1. 2.

상황

 

이클립스로 spring boot gradle 프로젝트 생성시에 'No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.1 was found.' 라는 에러가 발생했다.

 

 

 

 

에러 로그

 

 

 

NoMatchingConfigurationSelectionException: 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 16, 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 16
      - 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 16)
          - 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 16
      - 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 16
      - Other compatible attribute:
          - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
  - 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 16
      - Other compatible attribute:
          - Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
  - 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 16)
          - 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')
java.lang.reflect.InvocationTargetException

 

 

 

 

해결방법

 

build.gradle 에서 플러그인 'org.springframework.boot' 의 버전을 변경해주었다.

 

기존 코드 : id 'org.springframework.boot' version '3.0.1'

변경 코드 : id 'org.springframework.boot' version '2.7.5'

 

 

 

코드 수정 후 Refresh Gradle Project 해주면 반영된다.

 

 

 

 

 

참고자료

 

https://k-ang.tistory.com/73

반응형

댓글