SpringCloud Eureka - simple client doesnt register

Viewed 1402

I have an Eureka Server where I want to register a very basic SpringBoot service. Unfortunately the service doesnt register although I tried to follow all the articles I could find.

Moreover when I check description of the DiscoveryClient (that gets autowired), I see "Spring Cloud No-op DiscoveryClient" which suggests (as per NoopDiscoveryClient.java source) that Eureka client library isnt found.

In pom I have

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-netflix-eureka-client</artifactId>
    </dependency>

which if I am right should make sure that proper netflix libraries are in place. @EnableEurekaClient annotation is present. No errors on the console when starting the client, nothing interesting in the Eureka Server console logs.

This is the configuration from the application.yml:

    eureka:
      client:
        serviceUrl:
          defaultZone: ${vcap.services.eureka-service.credentials.uri:http://127.0.0.1:8761}/eureka/

Any suggestions are really welcomed as I am running out of ideas :)

2 Answers

Except @spencergibb's answer, in my case it also require <spring-cloud.version> inside the <properties>:

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <spring-cloud.version>Greenwich.M3</spring-cloud.version>
    </properties>
Related