(해결) Gradle Build Failed - Could not resolve org.springframework.boot:spring-boot-starter-aop:3.0.0.
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve org.springframework.boot:spring-boot-starter-aop:3.0.0.
Required by:
project : > org.springframework.boot:spring-boot-starter-data-jpa:3.0.0
> No matching variant of org.springframework.boot:spring-boot-starter-aop:3.0.0 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'apiElements' capability org.springframework.boot:spring-boot-starter-aop:3.0.0 declares a library for use during compile-time, 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 its target Java environment (preferred optimized for standard JVMs)
- Variant 'javadocElements' capability org.springframework.boot:spring-boot-starter-aop:3.0.0 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 environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them preferably in the form of class files)
- Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-starter-aop-maven-optional:3.0.0 declares a library for use during compile-time, 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 its target Java environment (preferred optimized for standard JVMs)
- Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-starter-aop-maven-optional:3.0.0 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 its target Java environment (preferred optimized for standard JVMs)
- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-starter-aop:3.0.0 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 its target Java environment (preferred optimized for standard JVMs)
- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-starter-aop:3.0.0 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 environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them preferably in the form of class files)
> Could not resolve org.springframework:spring-aspects:6.0.2.
Required by:
project : > org.springframework.boot:spring-boot-starter-data-jpa:3.0.0
> No matching variant of org.springframework:spring-aspects:6.0.2 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'apiElements' capability org.springframework:spring-aspects:6.0.2 declares a library for use during compile-time, 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 its target Java environment (preferred optimized for standard JVMs)
- Variant 'runtimeElements' capability org.springframework:spring-aspects:6.0.2 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 its target Java environment (preferred optimized for standard JVMs)
> Could not resolve org.springframework:spring-orm:6.0.0.
Required by:
project : > org.springframework.boot:spring-boot-starter-data-jpa:3.0.0 > org.springframework.data:spring-data-jpa:3.0.0
> No matching variant of org.springframework:spring-orm:6.0.0 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'apiElements' capability org.springframework:spring-orm:6.0.0 declares a library for use during compile-time, 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 its target Java environment (preferred optimized for standard JVMs)
- Variant 'runtimeElements' capability org.springframework:spring-orm:6.0.0 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 its target Java environment (preferred optimized for standard JVMs)
* 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 519ms
1 actionable task: 1 executed
원인 : 'spring-boot-starter-aop:3.0.0.'을 사용하려면 자바 17버전을 사용해야 한다.
해결 : build.gradle 파일에서 sourceCompatibility = '17' 로 바꾼다.
출처 : https://velog.io/@jollypyun/%EC%98%A4%EB%A5%98-%EA%B8%B0%EB%A1%9DCould-not-resolve-org.springframework.bootspring-boot-gradle-plugin3.0.1