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>

相关推荐
_小马快跑_40 分钟前
Java 的 8 大基本数据类型:为何是不可或缺的设计?
java
想用offer打牌1 小时前
高并发下如何保证接口的幂等性
后端·面试·状态机
爱勇宝2 小时前
2026一人公司生存指南:用AI大模型,90天跑出你的第一条现金流
前端·后端·架构
golang学习记2 小时前
Go 并发编程:原子操作(Atomics)完全指南
后端
哈里谢顿3 小时前
`127.0.0.1` 和 `0.0.0.0` 有何区别?通过验证 demo来展示
后端
树獭叔叔3 小时前
08-大模型后训练的指令微调SFT:LoRA让大模型微调成本降低99%
后端·aigc·openai
苏三说技术3 小时前
我终于遇到一台真正懂程序员的显示器!
后端
Re_zero3 小时前
线上日志被清空?这段仅10行的 IO 代码里竟然藏着3个毒瘤
java·后端
花落人散处3 小时前
流式输出——解决 HITL 难题 (SpringAIAlibaba)
后端
洋洋技术笔记3 小时前
Spring Boot条件注解详解
java·spring boot