Kristina
Kristina

Reputation: 4522

Spring Boot [2.7.5] is not compatible with this Spring Cloud release train: Eureka-client

Starting Eureka-client application and getting the error: Spring Boot [2.7.5] is not compatible with this Spring Cloud release train.

spring-boot-starter-parent 2.7.5

EurekaClientApplication package com.example.demo;
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient;

@SpringBootApplication
@EnableEurekaClient
public class EurekaClientApplication {
    public static void main(String[] args) {
        SpringApplication.run(EurekaClientApplication.class, args);        
    }
}

application.properties

eureka:
  client:
    serviceUrl:
          defaultZone: ${EUREKA_URI:http://localhost:8761/eureka}
instance:
    preferIpAddress: true
    lease-renewal-interval-in-seconds: 30

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>eureka-client</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>eureka-client</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>11</java.version>
        <spring-cloud.version>2020.0.2</spring-cloud.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bootstrap</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement> 
</project>

What can be the reason?

Upvotes: 0

Views: 7703

Answers (2)

Krzysztof Tomaszewski
Krzysztof Tomaszewski

Reputation: 1144

I'm not sure if you can use solutions coming from Netflix stack with Spring Cloud 2021.x at all. For sure Hystrix and Ribbon are no longer supported.

Upvotes: 1

probably the Spring Cloud version that you are using is not compatible with the Spring Boot version. It is defined in the tag:

<spring-cloud.version>2020.0.2</spring-cloud.version>

I think the 2021.0.5 spring-cloud version should work.

Upvotes: 0

Related Questions