Include the following changes:

- Upgrade Spring Cloud Consul to latest version
- Deploy the Spring Boot version as web as described in the article
- Add leadership-consul dependendencies
This commit is contained in:
Cavero Barca 2020-07-23 17:03:16 +02:00
parent cbdebb76ad
commit d8d00f117e
2 changed files with 26 additions and 5 deletions

View File

@ -12,6 +12,13 @@
<artifactId>spring-cloud</artifactId> <artifactId>spring-cloud</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies> <dependencies>
<dependency> <dependency>
@ -25,18 +32,32 @@
<artifactId>spring-cloud-starter-consul-config</artifactId> <artifactId>spring-cloud-starter-consul-config</artifactId>
<version>${spring-cloud-starter-consul.version}</version> <version>${spring-cloud-starter-consul.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot-starter-test.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.github.kinguinltdhk</groupId>
<artifactId>leadership-consul</artifactId>
<version>${kinguinltdhk.version}</version>
<exclusions>
<exclusion>
<groupId>com.ecwid.consul</groupId>
<artifactId>consul-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> </dependencies>
<properties> <properties>
<spring-cloud-starter-consul.version>1.3.0.RELEASE</spring-cloud-starter-consul.version> <spring-cloud-starter-consul.version>2.2.3.RELEASE</spring-cloud-starter-consul.version>
<spring-boot-starter-test.version>1.5.10.RELEASE</spring-boot-starter-test.version> <kinguinltdhk.version>0.3.1</kinguinltdhk.version>
<start-class>com.baeldung.spring.cloud.consul.discovery.DiscoveryClientApplication</start-class>
</properties> </properties>
</project> </project>

View File

@ -11,7 +11,7 @@ import static org.springframework.boot.WebApplicationType.NONE;
public class DiscoveryClientApplication { public class DiscoveryClientApplication {
public static void main(String[] args) { public static void main(String[] args) {
new SpringApplicationBuilder(DiscoveryClientApplication.class).web(NONE) new SpringApplicationBuilder(DiscoveryClientApplication.class)
.run(args); .run(args);
} }