【Spring Cloud Alibaba】开篇

本文介绍了Spring Cloud Alibaba作为分布式应用开发的一站式解决方案,包括官方描述、架构图和项目搭建步骤。通过添加注解和少量配置,可以将Spring Cloud应用接入阿里巴巴的分布式解决方案,构建基于阿里中间件的分布式系统。文章详细讲解了如何创建maven项目,配置pom,以及创建子模块并准备基础代码。
摘要由CSDN通过智能技术生成

一、简介

1.1 官方描述

Spring Cloud Alibaba provides a one-stop solution for distributed application development. It contains all the components required to develop distributed applications, making it easy for you to develop your applications using Spring Cloud.
With Spring Cloud Alibaba, you only need to add some annotations and a small amount of configurations to connect Spring Cloud applications to the distributed solutions of Alibaba, and build a distributed application system with Alibaba middleware.

1.2 架构图

在这里插入图片描述

图片来源:processon

1.3 模块

在这里插入图片描述

二、项目搭建

2.1 maven

创建maven项目,配置pom

<?xml version="1.0" encoding="UTF-8"?>
<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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.2</version>
    </parent>
    <groupId>cn.flowboot.e.commerce</groupId>
    <artifactId>E-commerce-cloud</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <!-- 工程项目版本 -->
        <E-commerce-cloud>1.0-SNAPSHOT</E-commerce-cloud>
        <!-- Spring Cloud 依赖 -->
        <spring.cloud.version>Hoxton.SR12</spring.cloud.version>
        <!-- spring cloud alibaba 依赖 -->
        <spring.cloud.alibaba.version>2.2.7.RELEASE</spring.cloud.alibaba.version>
        <!--  依赖 -->
        <lombok.version>1.16.18</lombok.version>
        <!-- commons-lang3 依赖 -->
        <commons-lang3.version>3.11</commons-lang3.version>
        <!-- commons-collections4 依赖 -->
        <commons-collections4.version>4.4</commons-collections4.version>
        <!-- hutool-all 依赖 -->
        <hutool-all.version>5.6.0</hutool-all.version>
        <!-- jwt  依赖 -->
        <jwt.version>0.11.2</jwt.version>
        <!-- fastjson 依赖 -->
        <fastjson.version>1.2.78</fastjson.version>
        <!-- mybatis plus 依赖 -->
        <mybatis-plus.version>3.4.2</mybatis-plus.version>
        <!-- druid 依赖 -->
        <druid.version>1.2.6</druid.version>
        <!-- bitwalker 依赖 -->
        <bitwalker.version>1.21</bitwalker.version>
        <!--  依赖 -->
        <swagger.version>3.0.0</swagger.version>
        <!-- kaptcha  依赖 -->
        <kaptcha.version>2.3.2</kaptcha.version>
        <!-- mybatis-spring  依赖 -->
        <mybatis-spring-boot.version>2.1.4</mybatis-spring-boot.version>
        <!-- pagehelper  依赖 -->
        <pagehelper.boot.version>1.3.1</pagehelper.boot.version>
        <!-- oshi 依赖 -->
        <oshi.version>5.8.0</oshi.version>
        <!-- jna 依赖 -->
        <jna.version>5.8.0</jna.version>
        <!--  io 依赖 -->
        <commons.io.version>2.11.0</commons.io.version>
        <!-- fileupload 依赖 -->
        <commons.fileupload.version>1.4</commons.fileupload.version>
        <!-- collections 依赖 -->
        <commons.collections.version>3.2.2</commons.collections.version>
        <!-- poi 依赖 -->
        <poi.version>4.1.2</poi.version>
        <!--  velocity 依赖 -->
        <velocity.version>1.7</velocity.version>

    </properties>


    <!-- 项目依赖管理 父项目只是声明依赖,子项目需要写明需要的依赖(可以省略版本信息) -->
    <dependencyManagement>
        <dependencies>
            <!-- spring cloud 依赖 -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- spring cloud alibaba 依赖 -->
            <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>

            <!-- lombok 工具通过在代码编译时期动态的将注解替换为具体的代码,   IDEA 需要添加 lombok 插件 -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-la
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值