We'll modify the service code structure of the eureka-server directory. We'll do so by following three steps:
- Maven dependency: First, we'll add a Spring Cloud dependency, as shown here, and a startup class with the @EnableEurekaServer annotation in pom.xml:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-eureka-server</artifactId>
</dependency>
- Startup class: Next, the startup class, App, will run the Eureka service seamlessly by just using the @EnableEurekaServer class annotation. This annotation does all the work for us. It adds /eureka endpoints, which provide the Eureka HTTP API. It also adds a Eureka UI, which displays the service instance tables with some other details: