javaspring-bootmicroserviceshystrixhystrix-dashboard

Spring cloud Netflix-Hystrix gradle dependency not allowing spring boot application to start


I have built simple microservice application using Spring-Boot and Eureka server. Now, I want to add fault-tolerance in case any of service registered in Eureka server is down. So, I used netflix-hystrix gradle dependency. But that dependency caused my application to crash.

I am getting following error message when running application:

Execution failed for task ':compileJava'. Could not resolve all files for configuration ':compileClasspath'. Could not find org.springframework.cloud:spring-cloud-starter-netflix-hystrix:.

For reference I have added snippet of build.gradle file.

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}"
    }
}

Solution

  • I believe you should also specify the version of the dependency:

    implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-hystrix', version: '2.2.7.RELEASE'