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>

相关推荐
豆瓣鸡16 分钟前
封装 API 请求日志切面——从注解定义到 Starter 自动装配
java·开发语言·spring boot
高明珠25 分钟前
麒麟 V10 SP1 踩坑:`./startup.sh` 报“解释器错误: 权限不够“,根因是 KySec
后端
用户83580861879137 分钟前
基于Redis的分布式锁优化实践:从Redlock到自适应自旋的实现与思考
后端
掘金者阿豪43 分钟前
想让短视频自动生产?用MoneyPrinterTurbo搭一个远程可控的AI创作平台
后端
掉鱼的猫1 小时前
把 OpenAPI 接入 Agent Harness:零代码让 Agent 听懂你的 REST API
java·llm·agent
梨子同志1 小时前
开发工具
前端·后端
梨子同志1 小时前
Java
后端
lzhcoder1 小时前
Spring Boot 集成 Kafka:先跑通 Demo,再避开那 80% 的人踩过的坑
java·kafka
像我这样帅的人丶你还1 小时前
Java 后端详解(六):Maven 与本地开发指南
前端·后端
tonydf1 小时前
.NET 项目集成可观测性:从架构思考到落地实践
运维·后端