搭建SpringCloudAlibaba开发环境之统一的依赖管理
统一依赖管理的作用
对公共的依赖进行统一的管理, 方便维护
方便对各个组件之间的版本关系进行管理
确认springboot、springcloud、springcloudalibaba版本之间的依赖关系
参考spring-cloud-alibaba官方文档
https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明
搭建springcloudalibaba的统一依赖管理
描述了springboot、springcloud、springcloudalibaba 三者之间的依
赖关系,springcloudalibaba基于springcloud、springcloud基于
springboot
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bygones</groupId>
<artifactId>bygones-dependencies</artifactId>
<version>1.0.0-SNAPSHOST</version>
<packaging>pom</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.5.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring.cloud.version>Hoxton.SR3</spring.cloud.version>
<spring.cloud.alibaba.version>2.2.1.RELEASE</spring.cloud.alibaba.version>
</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>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring.cloud.alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
在其他项目中引用统一的依赖管理
<parent>
<groupId>com.bygones</groupId>
<artifactId>bygones-dependencies</artifactId>
<version>1.0.0-SNAPSHOST</version>
<relativePath>../bygones-dependencies/pom.xml</relativePath>
</parent>