⚠️ This post covers Spring Cloud Edgware (2018) and is kept for reference only. For Spring Boot 3.x, see the updated Service Discovery with Eureka guide and the Spring Cloud Netflix migration guide.
This post contains pom.xml file and sample eureka server project built using Spring cloud version 1.5.18.RELEASE/ Edgware.SR5. Please refer Setting Up Eureka Server Using Spring Cloud post for detailed instructions.
You can download the whole project by using following link.
In case if you want to refer pom.xml only, I have pasted it below.
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>asm-eureka</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.18.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<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>Edgware.SR5</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</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>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
Understanding this pom.xml
A few notes on what makes this file work, since the version combination is the whole point of this post:
- Parent 1.5.18.RELEASE — pins the project to the Spring Boot 1.5 line. Everything else in the file must be compatible with this generation; you cannot mix a Boot 1.5 parent with a newer Spring Cloud train.
- spring-cloud.version = Edgware.SR5 — Edgware is the Spring Cloud release train matched to Boot 1.5.x. The dependencyManagement block imports its BOM, which is why none of the Spring Cloud dependencies below need explicit version numbers.
- spring-cloud-starter-netflix-eureka-server — the only functional dependency you need; it pulls in the Eureka server, its embedded web stack, and the registry dashboard.
- spring-boot-devtools — optional convenience for automatic restarts during development; safe to remove for a production build.
- spring-milestones repository — was required at the time to resolve some Edgware artifacts; harmless to keep, unnecessary for the final SR5 release artifacts available on Maven Central today.
With this pom in place, the application class only needs the @EnableEurekaServer annotation, exactly as shown in the main Eureka setup post — the annotation and properties are identical between Edgware and later versions; only the dependency coordinates differ.
Hope this post helped you!