springcloud-alibaba学习--springboot-springcloud及alibaba三者版本选择

tech2023-03-01  102

首先springcloud是依赖于springboot创建,springcloud-alibaba又是依赖于springcloud的体系的,所以版本选择顺序应该是springboot---->springcloud----->springcloudalibaba,你确定了springboot版本之后再去官网查询对应的springcloud版本及springcloudalibaba版本。

例如我本次选择的springboot版本是2.3.3

去查阅springcloud-alibaba官网资料:官网地址

并没有最新的springboot2.3.3的版本,我们先去查springboot与springcloud的版本对应关系

springboot 2.3.3可以确定是hoxton版本的springcloud,但是hoxton版本下面有更细的子版本所以要去查更详细的版本版本对应关系。

官网地址:https://start.spring.io/actuator/info

可以确定springcloud 使用的是hoxton.SR8

Hoxton.SR8"Spring Boot >=2.2.0.M4 and <2.3.4.BUILD-SNAPSHOT"

 从上面也知道alibaba的版本选择是2.2.1.RELEASE

至此本次的版本选择完成

附项目的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.3.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.venus</groupId> <artifactId>springcloud-alibaba-demo</artifactId> <version>0.0.1-SNAPSHOT</version> <name>springcloud-alibaba-demo</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> <spring-cloud.version>Hoxton.SR8</spring-cloud.version> <spring-cloud-alibaba.verison>2.2.1.RELEASE</spring-cloud-alibaba.verison> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter</artifactId> </dependency> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </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> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>${spring-cloud-alibaba.verison}</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> </project>

 

最新回复(0)