Spring Cloud Alibaba 项目工程准备

Java 专栏收录该内容
159 篇文章 1 订阅

创建工程

Spring Cloud 项目都是基于 Spring Boot 进行开发,并且都是使用 Maven 做项目管理工具。在实际开发中,我们一般都会创建一个依赖管理项目作为 Maven 的 Parent 项目使用,这样做可以极大的方便我们对 Jar 包版本的统一管理

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.1.6.RELEASE</version>
        <relativePath/> 
    </parent>

    <groupId>com.funtl</groupId>
    <artifactId>hello-spring-cloud-alibaba</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <url>http://www.funtl.com</url>

    <modules>
        <module>hello-spring-cloud-alibaba-dependencies</module>
    </modules>

    <properties>
        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>liwemin</id>
            <name>Lusifer Lee</name>
            <email>lee.lusifer@gmail.com</email>
        </developer>
    </developers>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.funtl</groupId>
                <artifactId>hello-spring-cloud-alibaba-dependencies</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <spring-javaformat.version>0.0.12</spring-javaformat.version>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.spring.javaformat</groupId>
                        <artifactId>spring-javaformat-maven-plugin</artifactId>
                        <version>${spring-javaformat.version}</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <includes>
                                <include>**/*Tests.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/Abstract*.java</exclude>
                            </excludes>
                            <systemPropertyVariables>
                                <java.security.egd>file:/dev/./urandom</java.security.egd>
                                <java.awt.headless>true</java.awt.headless>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-rules</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <bannedDependencies>
                                            <excludes>
                                                <exclude>commons-logging:*:*</exclude>
                                            </excludes>
                                            <searchTransitive>true</searchTransitive>
                                        </bannedDependencies>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-install-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                        <inherited>true</inherited>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>spring-milestone</id>
            <name>Spring Milestone</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-snapshot</id>
            <name>Spring Snapshot</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-milestone</id>
            <name>Spring Milestone</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-snapshot</id>
            <name>Spring Snapshot</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories></project>

创建依赖管理项目

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>

    <groupId>com.funtl</groupId>
    <artifactId>hello-spring-cloud-alibaba-dependencies</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <url>http://www.funtl.com</url>

    <properties>
        <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
        <spring-cloud-alibaba.verion>2.1.0.RELEASE</spring-cloud-alibaba.verion>
    </properties>

    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>liwemin</id>
            <name>Lusifer Lee</name>
            <email>lee.lusifer@gmail.com</email>
        </developer>
    </developers>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>${spring-cloud-alibaba.verion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>spring-milestone</id>
            <name>Spring Milestone</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-snapshot</id>
            <name>Spring Snapshot</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-milestone</id>
            <name>Spring Milestone</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-snapshot</id>
            <name>Spring Snapshot</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories></project>
  • 1
    点赞
  • 1
    评论
  • 1
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

<span>Spring Cloud Alibaba </span><span>致力于提供微服务开发的一站式解决方案。此项目包含开发分布式应用微服<br /> 务的必需组件,方便开发者通过 </span><span>Spring Cloud </span><span>编程模型轻松使用这些组件来开发分布式应用服务。<br /> 依托 </span><span>Spring Cloud Alibaba</span><span>,您只需要添加一些注解和少量配置,就可以将 </span><span>Spring Cloud </span><span>应用接<br /></span> <p> <span>入阿里微服务解决方案,通过阿里中间件来迅速搭建分布式应用系统。</span> </p> <p> <span><span>主要功能<br /></span>服务限流降级<span>:默认支持 </span><span>WebServlet</span><span>、 </span><span>WebFlux</span><span>, </span><span>OpenFeign</span><span>、 </span><span>RestTemplate</span><span>、 </span><span>Spring Cloud<br /> Gateway</span><span>, </span><span>Zuul</span><span>, </span><span>Dubbo </span><span>和 </span><span>RocketMQ </span><span>限流降级功能的接入,可以在运行时通过控制台实时修<br /> 改限流降级规则,还支持查看限流降级 </span><span>Metrics </span><span>监控。<br /></span>服务注册与发现<span>:适配 </span><span>Spring Cloud </span><span>服务注册与发现标准,默认集成了 </span><span>Ribbon </span><span>的支持。<br /></span>分布式配置管理<span>:支持分布式系统中的外部化配置,配置更改时自动刷新。<br /></span>消息驱动能力<span>:基于 </span><span>Spring Cloud Stream </span><span>为微服务应用构建消息驱动能力。<br /></span>分布式事务<span>:使用 </span><span>@GlobalTransactional </span><span>注解, 高效并且对业务零侵入地解决分布式事务问题。<br /></span>阿里云对象存储<span>:阿里云提供的海量、安全、低成本、高可靠的云存储服务。支持在任何应用、任<br /> 何时间、任何地点存储和访问任意类型的数据。<br /></span>分布式任务调度<span>:提供秒级、精准、高可靠、高可用的定时(基于 </span><span>Cron </span><span>表达式)任务调度服务。<br /> 同时提供分布式的任务执行模型,如网格任务。网格任务支持海量子任务均匀分配到所有<br /></span><span>Worker</span><span>(</span><span>schedulerx-client</span><span>)上执行。<br /></span>阿里云短信服务<span>:覆盖全球的短信服务,友好、高效、智能的互联化通讯能力,帮助企业迅速搭建<br /> 客户触达通道</span> <br /><br /></span> </p>
相关推荐
<p style="color:#333333;"> <strong> </strong> </p> <p style="font-family:"color:#222226;font-size:14px;background-color:#FFFFFF;"> <strong><span style="color:#337FE5;">[为什么要学习Spring Cloud微服务]</span> </strong> </p> <p style="font-family:"color:#222226;font-size:14px;background-color:#FFFFFF;"> <strong><span style="color:#4D555D;"></span> </strong> </p> <p class="ql-long-24357476" style="font-family:"color:#222226;font-size:14px;background-color:#FFFFFF;"> <strong><span style="font-family:"background-color:#FFFFFF;">SpringCloud作为主流微服务框架,<span style="color:#4D555D;">已成为各互联网公司的首选框架,国内外企业占有率持续攀升,</span>是Java工程师的必备技能。</span><span style="font-family:"background-color:#FFFFFF;">就连大名鼎鼎的阿里巴巴</span><span style="font-family:"background-color:#FFFFFF;">dubbo</span><span style="font-family:"background-color:#FFFFFF;">也正式更名为</span><span style="font-family:"background-color:#FFFFFF;">Spring Cloud Alibaba</span><span style="font-family:"background-color:#FFFFFF;">,成为了</span><span style="font-family:"background-color:#FFFFFF;">Spring Cloud </span><span style="font-family:"background-color:#FFFFFF;">微服务中的一个子模块。</span><span style="font-family:"background-color:#FFFFFF;"></span><span style="font-family:"background-color:#FFFFFF;">Spring Cloud是企业架构转型、个人能力提升、架构师进阶的不二选择。</span> </strong> </p> <p style="color:#333333;"> <strong><strong><br /> </strong> </strong> </p> <strong><span style="font-family:"color:#337FE5;font-size:14px;background-color:#FFFFFF;">【推荐你学习这门课的理由】</span><br /> </strong> <p> <br /> </p> <p> <span>1、</span><span style="color:#222226;font-family:"font-size:14px;background-color:#FFFFFF;">本课程总计</span><span style="background-color:#FFFFFF;">29</span><span style="color:#222226;font-family:"font-size:14px;background-color:#FFFFFF;">课时,<span style="color:#333333;">从微服务是什么、能够做什么开始讲起,绝对的零基础入门</span></span><span></span> </p> <p> <span style="background-color:#FFFFFF;">2、<span style="color:#333333;">课程附带全部26个项目源码,230页高清PDF正版课件</span><span style="color:#333333;"></span></span> </p> <p> <span style="background-color:#FFFFFF;"><b><br /> </b></span> </p> <p> <span style="background-color:#FFFFFF;"><b><span style="color:#337FE5;">【课程知识梳理】</span></b></span> </p> <p> <span style="background-color:#FFFFFF;"><b>1、</b></span><span style="color:#333333;">先讲解了什么是单体架构、什么是微服务架构、他们之间有什么区别和联系,各自有什么优缺点。</span> </p> <p> <span style="color:#333333;">2、</span><span style="color:#333333;">从本质入手,使用最简单的Spring Boot搭建微服务,让你认清微服务是一种思想和解决问题的手段,而不是新兴技术。</span> </p> <p style="color:#333333;"> 3、讲解Spring BootSpring Cloud 微服务架构之间的联系,原生的RestTemplate工具,以及Actuator监控端点的使用。 </p> <p style="color:#333333;"> 4、带着微服务所带来的各种优缺点,为大家引入服务发现与注册的概念和原理,从而引入我们的第一个注册中心服务Eureka。 </p> <p style="color:#333333;"> 5、引入负载均衡的理念,区分什么是服务端负载均衡,什么是客户端负载均衡,进而引入Ribbon负载均衡组件的详细使用。 </p> <p style="color:#333333;"> 6、为了解决微服务之间复杂的调用,降低代码的复杂度,我们引入了Feign声明式客户端,让你几行代码搞定服务的远程调用。 </p> <p style="color:#333333;"> 7、最后为大家介绍了整个微服务体系应该包含什么,学习路线是什么,应该学习什么。 </p> <p style="color:#333333;"> <strong><br /> </strong> </p> <p style="color:#333333;"> <strong><span style="color:#337FE5;">【</span><strong><span style="color:#337FE5;">学习方法</span></strong><span style="color:#337FE5;"></span><span style="color:#337FE5;">】</span></strong> </p> <p style="color:#333333;"> 每一节课程均有代码,最好的方式是静下心来,用一天的时间,或者两个半天时间来学习。 </p> <p style="color:#333333;"> 一边听我的讲解,一边使用我提供的项目代码进行观察和运行。 </p> <p style="color:#333333;"> 只要你能跟住我的节奏,你就可以搞定微服务。 </p> <br />
<p> <span style="color:#337fe5;"><strong> </strong></span> </p> <p class="MsoNormal"> <span style="color:#000000;font-size:16px;">本课程总计13大章节,115课时,是一门全面的SpringCloud微服务体系化课程。课程共包括</span><span style="color:#000000;font-size:16px;">十三个大章节,涵盖注册中心、网关、熔断、降级、监控、安全、限流等全部体系。</span><span style="color:#000000;font-size:16px;">包含阿里巴巴Nacos,Consul,Spring Cloud Gateway,OAuth2.0 JWT 等主流技术。</span> </p> <p class="MsoNormal"> <span style="color:#000000;font-size:16px;"> </span> </p> <p>   </p> <p> <span style="color:#337fe5;"><strong>[为什么要学习Spring Cloud微服务]</strong></span> </p> <p> <span style="color:#4d555d;"> </span> </p> <p class="ql-long-24357476" style="font-family:"color:#222226;font-size:14px;background-color:#ffffff;"> <span style="font-family:"background-color:#FFFFFF;"><span style="font-size:12px;">SpringCloud作为主流微服务框架,</span><span style="color:#4d555d;font-family:"background-color:#FFFFFF;font-size:12px;">已成为各互联网公司的首选框架,国内外企业占有率持续攀升,</span><span style="font-size:12px;">是Java工程师的必备技能。</span></span><span style="font-family:"background-color:#FFFFFF;font-size:12px;">就连大名鼎鼎的阿里巴巴</span><span style="font-family:"background-color:#FFFFFF;font-size:12px;">dubbo</span><span style="font-family:"background-color:#FFFFFF;font-size:12px;">也正式更名为</span><span style="font-family:"background-color:#FFFFFF;font-size:12px;">Spring Cloud Alibaba</span><span style="font-family:"background-color:#FFFFFF;font-size:12px;">,成为了</span><span style="font-family:"background-color:#FFFFFF;font-size:12px;">Spring Cloud </span><span style="font-family:"background-color:#FFFFFF;font-size:12px;">微服务中的一个子模块。</span><span style="font-family:"background-color:#FFFFFF;font-size:12px;">Spring Cloud是企业架构转型、个人能力提升、架构师进阶的不二选择。</span><span style="font-family:"background-color:#FFFFFF;"> </span> </p> <p class="ql-long-8780922" style="font-size:11pt;color:#494949;">   </p> <p class="ql-long-8780922" style="font-size:11pt;color:#494949;">   </p> <p class="ql-long-24357476" style="font-family:"color:#222226;font-size:14px;background-color:#ffffff;"> <span style="color:#337fe5;"><strong>【推荐你学习这门课的理由:<span style="color:#e53333;">知识体系完整+丰富学习资料】</span></strong></span> </p> <p class="ql-long-24357476" style="font-family:"color:#222226;font-size:14px;background-color:#ffffff;">   </p> <p class="MsoNormal"> 1、本课程总计13大章节,115课时,是一门全面的SpringCloud微服务体系化课程。 </p> <p class="MsoNormal"> 2、课程0基础入门,逐层递进深入,理论和代码相结合。 </p> <p class="MsoNormal"> 3、十三个大章节,涵盖注册中心、网关、熔断、降级、监控、安全、限流等全部体系。 </p> <p class="MsoNormal"> 4、包含阿里巴巴Nacos,Consul,Spring Cloud Gateway,OAuth2.0 JWT 主流技术。 </p> <p style="background:white;"> 5、课程附带230页高清PDF正版课件、Hoxton版本配套项目源码37个、Edgware版本配套项目26个,所有代码均有详细注释。 </p> <p>   </p> <p class="MsoNormal">   </p> <p> <span style="color:#337fe5;">【主讲讲师】</span> </p> <p> <span style="color:#337fe5;"><span style="color:#000000;">尹洪亮Kevin:</span><br /> <span style="color:#000000;">现任职某互联网公司首席架构师,负责系统架构、项目群管理、产品研发工作。</span><br /> <span style="color:#000000;">10余年软件行业经验,具有数百个线上项目实战经验。</span><br /> <span style="color:#000000;">擅长JAVA技术栈、高并发高可用伸缩式微服务架构、DevOps。</span><br /> <span style="color:#000000;">主导研发的蜂巢微服务架构已经成功支撑数百个微服务稳定运行</span></span> </p> <p> <span style="color:#337fe5;"><span style="color:#000000;"> </span></span> </p> <p>   </p> <p class="ql-long-24357476" style="font-family:"color:#222226;font-size:14px;background-color:#ffffff;"> <span style="color:#337fe5;"><strong>【学完后我将达到什么水平?】</strong></span> </p> <p class="MsoNoSpacing" style="margin-left:18.0pt;text-indent:-18.0pt;"> 1、 对Spring Cloud的各个组件能够熟练配置、开发、部署。 </p> <p class="MsoNoSpacing" style="margin-left:18.0pt;text-indent:-18.0pt;"> 2、 吊打一切关于Spring Cloud微服务的笔试面试题 </p> <p class="MsoNoSpacing" style="margin-left:18.0pt;text-indent:-18.0pt;"> 3、 能够上手搭建十分完整的微服务分布式系统,涵盖服务注册与发现、负载、网关、配置中心、监控、安全、熔断等。 </p> <p class="MsoNoSpacing" style="margin-left:18.0pt;text-indent:-18.0pt;"> 4、 对整个微服务体系架构有十分清晰准确的掌握。 </p> <p>   </p> <p class="ql-long-24357476"> <span style="font-family:""> </span> </p> <p class="MsoListParagraph" style="margin-left:36pt;text-indent:-36pt;" align="left"> <strong><span style="color:#337fe5;">【</span><span style="color:#337fe5;">面向人群</span><span style="color:#337fe5;">】</span></strong> </p> <p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;"> 1、 <span style="color:#4d555d;">不了解微服务是什么,</span>感觉微服务很难、不敢学,<span style="color:#4d555d;">网上资料松散,</span>没有好的学习资料 </p> <p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;"> 2、 这么多年还一直在写SSH、SSM项目,没有更新过自己的知识体系。 </p> <p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;"> 3、 Spring Cloud组件太多,不知道应该重点关注和学习哪些。 </p> <p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;"> 4、 不会搭建微服务项目、依赖项目太多、完全搞不清楚。 </p> <p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;">   </p> <p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;"> <span style="color:#337fe5;"><strong>【课程知识体系图】</strong></span> </p> <p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;"> <span style="color:#337fe5;"><strong><img src="https://img-bss.csdnimg.cn/202007100719132383.png" alt="" /><br /> </strong></span> </p>
©️2020 CSDN 皮肤主题: 护眼 设计师:闪电赇 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值