【发布时间】:2021-06-21 01:15:54
【问题描述】:
我使用 Spring-Boot 和 Eureka server 构建了简单的微服务应用程序。现在,我想添加容错,以防在 Eureka 服务器中注册的任何服务关闭。所以,我使用了 netflix-hystrix gradle 依赖。但是这种依赖导致我的应用程序崩溃。
我在运行应用程序时收到以下错误消息:
Execution failed for task ':compileJava'. Could not resolve all files for configuration ':compileClasspath'. Could not find org.springframework.cloud:spring-cloud-starter-netflix-hystrix:.
作为参考,我添加了 build.gradle 文件的 sn-p。
plugins {
id 'org.springframework.boot' version '2.4.4'
}
ext {
set('springCloudVersion', "2020.0.2")
}
dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
【问题讨论】:
标签: java spring-boot microservices hystrix hystrix-dashboard