spring-cloud-alibaba-dependencies compatible with spring boot and cloud

The spring-cloud-alibaba-dependencies BOM (Bill of Materials) simplifies managing compatible versions of Spring Cloud Alibaba dependencies in your project. Here's how you can use it effectively:


1. What is spring-cloud-alibaba-dependencies?

  • It is a dependency management BOM provided by Spring Cloud Alibaba to ensure compatibility between its components and Spring Boot/Spring Cloud versions.
  • It defines specific versions for Spring Cloud Alibaba modules like nacos-config, nacos-discovery, and others.

2. How to Use spring-cloud-alibaba-dependencies?

Maven Configuration

Add it to your <dependencyManagement> section for managing dependencies:

<dependencyManagement> <dependencies> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>2021.0.1.0</version> <!-- Use the appropriate version --> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> </dependency> </dependencies>

Gradle Configuration

In Gradle, you can use the BOM like this:

dependencies { implementation platform('com.alibaba.cloud:spring-cloud-alibaba-dependencies:2021.0.1.0') implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config' }


3. Choosing the Right Version

The version of spring-cloud-alibaba-dependencies you select depends on the Spring Boot and Spring Cloud versions you're using. Here's a compatibility guide:

Spring Cloud Alibaba Version Spring Boot Version Spring Cloud Version
2.2.5.RELEASE 2.3.x Hoxton.SR8
2021.0.1.0 2.5.x 2020.0.x
2022.0.1.0 2.7.x or 3.x 2021.x

Refer to the official Spring Cloud Alibaba compatibility documentation for updates.


4. Why Use spring-cloud-alibaba-dependencies?

  • It simplifies version management by ensuring all Spring Cloud Alibaba modules are compatible with each other.
  • Reduces conflicts and errors caused by mismatched versions of dependencies.

5. Example Project Setup

Maven Full Example
复制代码

<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.15</version> </parent> <dependencyManagement> <dependencies> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>2021.0.1.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> </dependency> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </dependency> </dependencies>

相关推荐
import_random1 分钟前
[深度学习]5大神经网络架构(介绍)
后端
pengyu11 分钟前
【Java设计原则与模式之系统化精讲:壹】 | 编程世界的道与术(实战指导篇)
java·后端·设计模式
日月星辰Ace14 分钟前
JVM 垃圾回收简介
java
陈随易15 分钟前
一行代码,将网页元素变成图片!比 html2canvas 快 93 倍的截图神器来了!
前端·后端·程序员
Kookoos15 分钟前
性能剖析:在 ABP 框架中集成 MiniProfiler 实现性能可视化诊断
后端·c#·.net·abp vnext·miniprofiler
掉头发的王富贵17 分钟前
Arthas神器入门:动态调试Java应用,轻松搞定生产环境Bug!
java·后端·debug
汪子熙21 分钟前
解密 Fabric 体系 —— 架构与实践全解析
后端
Java陈序员22 分钟前
再见 Navicat!一款开源的 Web 数据库管理工具!
java·react.js·docker
oraen23 分钟前
一篇文章让你在根本上理解遗传算法,用牛刀杀鸡-使用遗传撕力扣
后端
程序员爱钓鱼24 分钟前
Go语言并发模型与模式:Worker Pool 模式
后端·go·排序算法