我试图在一个示例应用程序中实现Resilience4j,并从正式文档中跟踪演示应用程序。但是,添加下面的依赖项会给我一个分级错误:
Unresolved dependency: org.springframework.cloud spring-cloud-starter-circuitbreaker-reactor-resilience4j这是我的build.gradle
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()
}发布于 2022-09-09 07:12:46
尝试将版本更改为1.7.0。几天前我也犯过类似的错误。由于某些原因,似乎存在与spring-boot2工件相关的传递依赖关系的问题。工件本身在1.7.1版本中,但所有传递依赖项都是1.7.0。
在更改之后,所有版本都是1.7.0,并且工作正常。
https://stackoverflow.com/questions/73331466
复制相似问题