当我尝试使用Spring Cloud Stream构建Gradle Spring Boot项目时,收到以下错误:
Execution failed for task ':compileTestJava'.
> Could not resolve all files for configuration ':testCompileClasspath'.
> Could not find org.springframework.cloud:spring-cloud-stream:test-binder.
Required by:
project :
> Could not find org.springframework.cloud:spring-cloud-stream:test-binder.
Required by:
project :
> Could not find org.springframework.cloud:spring-cloud-stream:test-binder.
Required by:
project : > org.springframework.cloud:spring-cloud-stream-binder-kafka-streams:3.0.9.RELEASE > org.springframework.cloud:spring-cloud-stream-binder-kafka-core:3.0.9.RELEASE如果我删除以下依赖项,则项目可以正常工作:
testImplementation 'org.springframework.cloud:spring-cloud-stream:test-binder@test-jar'
该项目是使用Spring initilizr通过此configuration生成的。
我可以更改哪些内容才能成功构建项目?
发布于 2020-12-07 07:47:51
变化
testImplementation 'org.springframework.cloud:spring-cloud-stream:test-binder@test-jar'至
testImplementation("org.springframework.cloud:spring-cloud-stream") {
artifact {
name = "spring-cloud-stream"
extension = "jar"
type ="test-jar"
classifier = "test-binder"
}
}目前,Spring Initializr生成的Gradle项目都有这个错误,这个问题在#1159和#591中有文档记录。
https://stackoverflow.com/questions/65174347
复制相似问题