개발/Spring
[ Spring boot] Could not resolve all files for configuration compileClasspath
쩨이엠
2020. 8. 24. 15:56
728x90
반응형
기본만 있었던 dependency에 redis를 추가해야할 일이 생겼다
build.gradle 에 추가해준다
dependencies {
...
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
implementation 'org.springframework.session:spring-session-data-redis'
...
}
추가해 준 후 version이 없다는 에러가 났다
그 위에 plugins을 추가해준다
plugins {
id 'org.springframework.boot' version '2.3.3.RELEASE'
}
dependencies {
...
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
implementation 'org.springframework.session:spring-session-data-redis'
...
}
이렇게 plugins으로 추가하면 이 버전에 맞는 버전들로 하위 dependency 버전을 제어할 수 있다
이제 되겠지
$ gradle build
> Task :iot_gw:compileJava FAILED
During the build, one or more dependencies that were declared without a version failed to resolve:
org.springframework.session:spring-session-data-redis:
org.springframework.boot:spring-boot-starter-data-redis-reactive:
Did you forget to apply the io.spring.dependency-management plugin to the iot_gw project?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':iot_gw:compileJava'.
> Could not resolve all files for configuration ':iot_gw:compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-data-redis-reactive:.
Required by:
project :iot_gw
> Could not find org.springframework.session:spring-session-data-redis:.
Required by:
project :iot_gw
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
1 actionable task: 1 executed
칼같이 에러가 났다
구글링을 해도 plugins를 하라는 말밖에 하지 않았다
자세히 읽어봐도 모르겠는데 forget..? 뭘 잊었냐고 묻는다
봤더니 plugin 중에 io.spring.dependency-management 를 적용했냐는 물음이 있다
재빨리 적용해본다
plugins {
id 'org.springframework.boot' version '2.3.3.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
}
dependencies {
...
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
implementation 'org.springframework.session:spring-session-data-redis'
...
}
그 후 빌드해보면 제대로 빌드가 되는 것을 확인할 수 있다
$ gradle build
BUILD SUCCESSFUL in 12s
3 actionable tasks: 1 executed, 2 up-to-date
728x90
반응형