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>

相关推荐
Ciderw3 分钟前
Go中的三种锁
开发语言·c++·后端·golang·互斥锁·
神探阿航9 分钟前
第十五届蓝桥杯大赛软件赛省赛C/C++ 大学 B 组
java·算法·蓝桥杯
梓沂19 分钟前
idea修改模块名导致程序编译出错
java·ide·intellij-idea
m0_7482463543 分钟前
SpringBoot返回文件让前端下载的几种方式
前端·spring boot·后端
m0_748230441 小时前
创建一个Spring Boot项目
java·spring boot·后端
卿着飞翔1 小时前
Java面试题2025-Mysql
java·spring boot·后端
C++小厨神1 小时前
C#语言的学习路线
开发语言·后端·golang
心之语歌1 小时前
LiteFlow Spring boot使用方式
java·开发语言
计算机-秋大田2 小时前
基于微信小程序的校园失物招领系统设计与实现(LW+源码+讲解)
java·前端·后端·微信小程序·小程序·课程设计
綦枫Maple2 小时前
Spring Boot(6)解决ruoyi框架连续快速发送post请求时,弹出“数据正在处理,请勿重复提交”提醒的问题
java·spring boot·后端