博客園html
建議先選擇Spring Cloud Alibaba的大版本,方便兼容java
因爲Alibaba已經指出了最合適的版本,因此咱們不去SpringCloud官網查詢合適版本,直接使用Alibaba官方提供的建議便可:mysql
備忘用,若是須要單獨使用Spring Cloud,則可參考git
然後便可查看到推薦版本
github
若是想查看指定大版本的推薦版本(可選)
直接訪問 https://docs.spring.io/spring-cloud/docs/大版本號/reference/html/,如 https://docs.spring.io/spring-cloud/docs/Hoxton.SR10/reference/html/spring
查看版本兼容範圍(可選)
訪問連接sql
註冊中心apache
服務調用後端
服務降級mybatis
服務網關
服務配置
服務總線
以訂單項目爲例,演示SpringCloud和SpringCloudAlibaba的使用,代碼可從此處下載
<?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.spz.demo</groupId> <artifactId>spring-cloud-demo</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <!-- 後續新增模塊後,須要在此處聲明 --> <modules> <!-- <module>xxx</module> --> </modules> <!-- 統一管理jar包版本 --> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <junit.version>4.12</junit.version> <log4j.version>1.2.17</log4j.version> <lombok.version>1.16.18</lombok.version> <mysql.version>8.0.16</mysql.version> <druid.version>1.1.16</druid.version> <mybatis.plus.version>3.3.2</mybatis.plus.version> </properties> <dependencyManagement> <dependencies> <!-- Spring Boot--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>2.3.2.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> <!-- Spring Cloud --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Hoxton.SR8</version> <type>pom</type> <scope>import</scope> </dependency> <!-- Spring Cloud Alibaba --> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>2.2.5.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.version}</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>${druid.version}</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>${mybatis.plus.version}</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <optional>true</optional> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <addResources>true</addResources> </configuration> </plugin> </plugins> </build> </project>
QQ羣
歡迎加入Java交流羣(qq羣號: 776241689 )
公衆號
PS:小到Java後端技術、計算機基礎知識,大到微服務、Service Mesh、大數據等,都是本人研究的方向。我將按期在公衆號中分享技術乾貨,但願以我一己之力,拋磚引玉,幫助朋友們提高技術能力,共同進步!
博客
原創不易,轉載請在開頭著名文章來源和做者。若是個人文章對您有幫助,請點贊/收藏/關注鼓勵支持一下吧❤❤❤❤❤❤