Gradle Spring Cloud Stream 项目因测试依赖性而未构建
Gradle Spring Cloud Stream project does not build because of test dependency
当我尝试使用 Spring Cloud Stream 构建 Gradle Spring 引导项目时,我收到以下错误:
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。
我可以更改什么才能成功构建项目?
改变
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.
当我尝试使用 Spring Cloud Stream 构建 Gradle Spring 引导项目时,我收到以下错误:
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。
我可以更改什么才能成功构建项目?
改变
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.