πŸ› [Spring Boot] Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.4. 이슈 ν•΄κ²°

μ΄μ„œΒ·2023λ…„ 10μ›” 16일
0

κ°œμš”

Spring Boot 3.1.4 버전을 μ‚¬μš©ν•˜λ©΄μ„œ Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.4. μ—λŸ¬κ°€ λ°œμƒν•˜λ©° Gradle λΉŒλ“œκ°€ μ‹€νŒ¨ν•˜λŠ” μ΄μŠˆκ°€ λ°œμƒλμ–΄μš”.

개발 ν™˜κ²½

  • Spring Boot: 3.1.4
  • Language: Java 17
  • Build Tool: Gradle 8.3
  • IDE: Intellij Ultimate

μ—λŸ¬ 둜그

A problem occurred configuring root project 'spring-demo'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.4.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.1.4
      > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.4 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.3' but:
          - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 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 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
          - Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 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 8)
                  - 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.3')
          - Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.4 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 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
          - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.4 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 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
          - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 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 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.3')
          - Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 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 8)
                  - 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.3')

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

원인

Spring bootκ°€ 3 λ²„μ „λŒ€λ‘œ μ˜¬λΌκ°€λ©΄μ„œ Java 버전을 17 μ΄μƒλΆ€ν„°λ§Œ μ§€μ›ν•˜κ²Œ λ˜μ—ˆμ–΄μš”. 이에 따라 Gradle JVM μžλ°” 버전 섀정이 17둜 섀정이 λ˜μ–΄μžˆμ§€ μ•Šμ•„ λ°œμƒν–ˆμ–΄μš”.

ν•΄κ²° 방법

Gradle JVM을 17λ²„μ „μœΌλ‘œ λ§žμΆ”μ–΄ ν•΄κ²°ν•  수 μžˆμ—ˆμ–΄μš”.

  1. Settings β†’ Build, Execution, Deployment β†’ Build Tools β†’ Gradle
  2. Gradle JVM: Project SDK λ˜λŠ” κ°œλ³„μ μœΌλ‘œ 받은 Java 17 이상 λ²„μ „μœΌλ‘œ μ„€μ •ν•΄μ£Όμ„Έμš”.
profile
πŸŽοΈπŸ’¨ Beep Beep

0개의 λŒ“κΈ€