[IntelliJ] μ κ· μμ± νλ‘μ νΈμ λΉλ μ€λ₯ (Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.1)
μ΅κ·Ό 2λ μ λ IntelliJμμ Java 11 κΈ°λ°μ AWS Correto 11 μ μ¬μ©ν΄μμ΅λλ€
κ·Έλμ νμ¬ JAVA_HOME μ AWS Correto 11 μ μμΉλ₯Ό κ°λ¦¬ν€κ³ μμμ΅λλ€.
μ κ· νλ‘μ νΈ κ΅¬μ±ν μΌμ΄ μκ²Όκ³
AWS Correto 17 μ 미리 λ€μ΄λ°μλ μνμμ
IntelliJ μμ SpringBoot Initializer λ₯Ό μ΄μ©ν΄μ
μλμ κ°μ μ€μ (Java 17 + gradle groovy)μΌλ‘ νλ‘μ νΈλ₯Ό μμ±νκ³
λΉλλ₯Ό νλ μ€λ₯κ° λ°μνμ΅λλ€.
μλλ λΉλμ λ°μνλ μ€λ₯ λ©μμ§
A problem occurred configuring root project 'my-new-springboot3-project'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.1.
Required by:
project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.2.1
> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.2.1 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.1 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.1 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.1 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.1 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.1 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.1 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 1s
μλ¬ λ©μμ§μ λ΄μ©μ μ½μ΄λ³΄λ, μΌλ¨ Could not resolve xxx μ κ²½μ° xxx λΌμ΄λΈλ¬λ¦¬κ° μλ€λΌλ λ©μμ§μΈλ°
μ κ· μμ±ν νλ‘μ νΈμμ νμλΌμ΄λΈλ¬λ¦¬λ₯Ό dependencyμ μλ£μ μ΄μ κ° μλ€λ μκ°μ΄ μ°μ λ€μμ΅λλ€.
κ·Έλ°κ±°λΌλ©΄ springboot initializer μ λ²κ·ΈμΌν λκΉμ.
κ·Έλμ λ μ½μ΄λ΄€μ΅λλ€.
κ·Έλ¦¬κ³ "requierd compatibility with Java 11" λ¬Έκ΅¬κ° λμ λμμ΅λλ€.
λ μλ°17μ μ°λ €κ³ 17λ²μ μΌλ‘ JDKμ Java μ€μ μ λ£μλλ° μ Java 11 κ΄λ ¨λ©μμ§κ° λ¨λκ±΄μ§ μ΄μνμ΅λλ€. π€
μλ¬λ©μμ§ λ΄μ©μΌλ‘ ꡬκΈλ§μ μ’ ν΄λ³΄λ μλ λΆλΆλ€μ νμΈν΄λ³΄λΌλ λ΄μ©λ€μ΄ μμμ΅λλ€.
- νμ¬ μμ€ν μμ μ¬μ©νλ Java λ²μ νμΈ (java -version)
- build.gradle νμΌμ sourceCompatibility νμΈ
- IntelliJ μ project SDK μ€μ νμΈ
- gradle JVM μ€μ νμΈ
μΌλ¨ λΉλμμ λ°μνκ³ , λΉλν΄μ gradle μ΄λΌλ κ±Έ μ΄λ―Έ νλ‘μ νΈ μμ±μ μ€μ μ ν΄μ£Όμκ³ , IntelliJμ gradle μ΄ μ¬μ©ν μλ°λ²μ μ μ€μ νλ λ΄μ©μ΄ μλ€λ κ²μ μκ³ μμκΈ°μ gradle JVM μ€μ μ λ¨Όμ νμΈν΄λ΄€μ΅λλ€.
gradle JVM μ€μ μ΄ κΈ°μ‘΄ μ€μ κ·Έλλ‘ Java 11μ μ¬μ©νλλ‘ λμ΄μμμ΅λλ€. π
νλ‘μ νΈ μμ±μ correto 17, Java 17 λ²μ μ μ€μ ν΄μ£ΌμκΈ°μ sourceCompatibility μ project SDK λ 17λ²μ μ μ¬μ©νλλ‘ λμ΄μμκ³ , JAVA_HOMEμ μ€μ λμ΄μλ νμ¬ μμ€ν μμ κΈ°λ³ΈμΌλ‘ μ¬μ©μ€μΈ Java λ²μ κ³Όλ κ΄κ³κ° μμμ΅λλ€.
gradle JVM μ€μ νμΈ λ°©λ²
Preferences/Settings (β + , ) > Build, Execution, Deployment > Build Tools > Gradle
project SDK μ€μ νμΈ λ°©λ²
File > Project Structure.. (β + ; )
build.gradle νμΌμ sourceCompatibility νμΈ λ°©λ²