首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spring Resilience4J:未解决的依赖关系

Spring Resilience4J:未解决的依赖关系
EN

Stack Overflow用户
提问于 2022-08-12 08:40:11
回答 1查看 130关注 0票数 0

我试图在一个示例应用程序中实现Resilience4j,并从正式文档中跟踪演示应用程序。但是,添加下面的依赖项会给我一个分级错误:

代码语言:javascript
复制
Unresolved dependency: org.springframework.cloud spring-cloud-starter-circuitbreaker-reactor-resilience4j

这是我的build.gradle

代码语言:javascript
复制
plugins {
    id 'org.springframework.boot' version '2.7.2'
    id 'io.spring.dependency-management' version '1.0.12.RELEASE'
    id 'java'
}

group = 'com.thomsoncodes'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
    mavenCentral()
}

ext {
    set('springCloudVersion', "2021.0.3")
}
ext{
    resilience4jVersion = '1.7.1'
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'io.projectreactor:reactor-test'
    
    compile('org.springframework.boot:spring-boot-starter-aop')
    compile("io.github.resilience4j:resilience4j-spring-boot2:${resilience4jVersion}")
    compile("io.github.resilience4j:resilience4j-all:${resilience4jVersion}") // Optional, only required when you want to use the Decorators class
    compile("io.github.resilience4j:resilience4j-reactor:${resilience4jVersion}")
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}

tasks.named('test') {
    useJUnitPlatform()
}
EN

回答 1

Stack Overflow用户

发布于 2022-09-09 07:12:46

尝试将版本更改为1.7.0。几天前我也犯过类似的错误。由于某些原因,似乎存在与spring-boot2工件相关的传递依赖关系的问题。工件本身在1.7.1版本中,但所有传递依赖项都是1.7.0。

在更改之后,所有版本都是1.7.0,并且工作正常。

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

https://stackoverflow.com/questions/73331466

复制
相关文章

相似问题

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