This is the ninth day of my participation in the August More text Challenge. For details, see: August More Text Challenge

review

Continuing with the series of components of SpringCloud, today I'll summarize the versioning dependencies in use.Copy the code

The premise

The first thing we need to know is that SpringCloud is named according to the London underground station. When developing it, it should be noted that each version of SpringCloud depends on the same component version. You can’t just choose a few version components to rely on.

Here’s what he says on his website:As indicated above, more information about naming conventions of Release Trains can be used to select versions during development.

Hoxton will be the last named release train. The SpringCloud team will be releasing new releases with year, month, day and change points.

Start approaching SpringCloud

1. View the version

For now, I chose the spring-Cloud-2020-0-0-M1-released version provided by the official website.

The following is the recommended version of each component on the official website corresponding to the current version I selected:

Official website address:Spring. IO/blog / 2020/0…

If you have an existing Spring Boot application and want to add Spring Cloud to it, the first step is to determine which version of Spring Cloud you should use. Spring Cloud and Spring Boot

2. The introduction of the Maven

Maven’s dependencies on components are shown below (also examples from the website) :

<repositories> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> < artifactId > spring - cloud - dependencies < / artifactId > < version > 2020.0.0 - M1 < / version > < type > pom < type > the < scope > import < / scope >  </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <! -... --> </dependencies>Copy the code

2. The introduction of Gradle

The code is also provided on the website

Plugins {id 'org.springframework.boot' version '2.3.0.m4' id 'IO. Spring. Dependency -management' version '1.0.9.RELEASE' id 'java' } repositories { mavenCentral() maven { url 'https://repo.spring.io/milestone' } } ext { set('springCloudVersion', "2020.0.0-m1 ")} dependencyManagement {imports {mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" } } dependencies { compile 'org.springframework.cloud:spring-cloud-starter-config' compile 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' //... }Copy the code

conclusion

As can be seen from the above, before we develop, we can go to the corresponding official website to understand the basic knowledge of him. The more the development of more components, the more we should establish the version we want to build at the beginning, to understand the advantages of the version, and choose the suitable stable version to develop on this.

Emphasize: I want to emphasize once again the official document is our best teacher!!