I am developing a code from https://www.dineshonjava.com/microservices-with-spring-boot/. When I update the spring-boot-starter-parent from 1.5.4.RELEASE
to 2.0.4.RELEASE
, build got failed.
Could anyone please guide me what is the issue ?
Project build error: 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-eureka-server:jar is missing.
Another error:
Multiple annotations found at this line:
- For artifact {org.springframework.cloud:spring-cloud-starter-eureka-server:null:jar}: The version cannot be empty. (org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources:default-resources:process-
resources) org.apache.maven.artifact.InvalidArtifactRTException: For artifact {org.springframework.cloud:spring-cloud-starter-eureka-server:null:jar}: The version cannot be empty. at
org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:148) at org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:123) at
org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:157) at org.apache.maven.artifact.factory.DefaultArtifactFactory.createDependencyArtifact(DefaultArtifactFactory.java:
57) at org.apache.maven.project.artifact.MavenMetadataSource.createDependencyArtifact(MavenMetadataSource.java:328) at
org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(MavenMetadataSource.java:503) at
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.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>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<!-- Eureka registration server -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</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>Camden.SR5</version> -->
<version>Finchley.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Eureka Server is an application that holds the information about all client-service applications. Every Micro service will register into the Eureka server and Eureka server knows all the client applications running on each port and IP address. Eureka Server is also known as Discovery Server.
Navigate to https://start.spring.io. Set the artifact to “rating-service”. Search for “web” and add that dependency. Search for “config client” and add that dependency.
Spring Cloud is Configuration server technology and communicate with many services and collect in one Application. Spring boot is a java based framework to work con auto-configuration in Web Application. Spring cloud is part of Spring boot, where Spring boot is Stand Alone, App – Centric Application framework.
As indicated in my comment, some starters were renamed: https://github.com/spring-projects/spring-cloud/wiki/Spring-Cloud-Edgware-Release-Notes
A number of starters did not follow normal Spring Cloud naming conventions. In Edgware, use of the deprecated starter will log a warning with the name of the new starter to use in its place.
So change:
spring-cloud-starter-eureka-server
to spring-cloud-starter-netflix-eureka-server
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With