๐ป Programming
[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 ํ์ธ ๋ฐฉ๋ฒ
'๐ป Programming' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Git] ๊ฐ์ธํ๋ก์ ํธ ์ฒ์ ์์์ github ๊ด๋ จ ์ค๋ฅ ํด๊ฒฐ๋ฐฉ๋ฒ (0) | 2024.07.02 |
---|---|
Spock Test Framework ์คํ ์ค๋ฅ ํด๊ฒฐ (2) | 2024.01.03 |
SpringBoot 2.3 -> 2.5 ์ ๊ทธ๋ ์ด๋ ํ๊ธฐ (0) | 2023.12.29 |
[AWS/SQS] cloudwatch datapoint ์กฐํํ๊ธฐ (2) | 2022.12.29 |
MariaDB๋ก AWS Aurora ์ฐ๋์ readOnly ํธ๋์ญ์ ์ด writer ์ชฝ์์ ์คํ๋๋ ํ์ ๋ถ์ (0) | 2022.12.26 |