SpringBoot 和 SpringCloud 版本大体对应(表粗为当前公司项目使用的版本)
spring-boot-starter-parent(Spring Boot)
spring-cloud-dependencie (SpringCloud版本名称由伦敦地铁站)
1.2.x
Angel版本
1.3.x
Brixton版本
1.4.x
Camden版本
1.5.2.RELEASE
Dalston.RC1
1.5.2.RELEASE
Dalston.RC1
1.5.16/20.RELEASE
Edgware.RELEASE
>=2.0.0.M3 and <2.0.0.M5
Finchley.M2
pring Boot >=2.0.0.M5 and <=2.0.0.M5
Finchley.M3
Spring Boot >=2.0.0.M6 and <=2.0.0.M6
Finchley.M4
Spring Boot >=2.0.0.M7 and <=2.0.0.M7
Finchley.M5
Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1
Finchley.M6
Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2
Finchley.M7
Spring Boot >=2.0.0.RELEASE and <=2.0.0.RELEASE
Finchley.M9
Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE
Finchley.RC1
Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE
Finchley.RC2
Spring Boot >=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT
Finchley.SR4
Spring Boot >=2.0.999.BUILD-SNAPSHOT and <2.1.0.M3
Finchley.BUILD-SNAPSHOT
Spring Boot >=2.1.0.M3 and <2.1.0.RELEASE
Greenwich.M1
Spring Boot >=2.1.0.RELEASE and <2.1.9.BUILD-SNAPSHOT
Greenwich.SR2
Spring Boot >=2.1.9.BUILD-SNAPSHOT and <2.2.0.M4
Greenwich.BUILD-SNAPSHOT
Spring Boot >=2.2.0.M4 and <=2.2.0.M5
Hoxton.M2
Spring Boot >=2.2.0.BUILD-SNAPSHOT
Hoxton.BUILD-SNAPSHOT
配置文件(pom.xml)对应如下:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version> <!-- spring boot 版本 -->
<relativePath/>
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<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>Greenwich.SR2</spring-cloud.version> <!-- spring boot 2.1.7.RELEASE版本对应的spring cloud版本 -->
</properties>
<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>
</project>
注1.pom内部引用 则用 ${标签名} 来获取参数