首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于测试依赖,Gradle Spring Cloud Stream项目无法构建

由于测试依赖,Gradle Spring Cloud Stream项目无法构建
EN

Stack Overflow用户
提问于 2020-12-07 07:47:51
回答 1查看 500关注 0票数 0

当我尝试使用Spring Cloud Stream构建Gradle Spring Boot项目时,收到以下错误:

代码语言:javascript
复制
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生成的。

我可以更改哪些内容才能成功构建项目?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-07 07:47:51

变化

代码语言:javascript
复制
testImplementation 'org.springframework.cloud:spring-cloud-stream:test-binder@test-jar'

代码语言:javascript
复制
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中有文档记录。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65174347

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档