SpringBoot, SpringCloud, SpringCloudAlibab corresponding version selection

1: SpringBoot version selection

git address:

https://github.com/spring-projects/spring-boot/releases/

How to choose version

insert image description here
By checking the official address of springboot, as of September 2022, the latest version is 2.7.3, so should we use this version? No, next we need to look at the corresponding version of springcloud to choose the springboot version

The official website recommends that you must use a version later than 2.x

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes
Click on the URL, we can see that the official has strongly recommended upgrading to 2.x; so we don't want to Stable, then choose the 1.x version
insert image description here

2: SpirngCloud version selection

git address:

https://github.com/spring-projects/spring-cloud
You can see that springcloud is no longer maintained on github, go to the official website to check
insert image description here

springcloud official website

https://spring.io/projects/spring-cloud
insert image description here
We can see that the latest stable version of springcloud (GA-(Generally Available), indicating a stable version) as of September 2022 is 2021.0.3
Note: Explain why there are still springcloud versions letter

The version relationship of Spring Cloud Spring Cloud is named after the London subway station in England, and releases iterative versions in the form of the subway station name AZ and so on. Spring Cloud is a comprehensive project composed of many sub-projects. Each sub-project has different Release cadence. In order to manage the version dependencies between SpringCloud and each sub-project, a list is released, which includes the sub-project version corresponding to a SpringCloud version. In order to avoid confusion between the SpringCloud version number and the sub-project version number, the SpringCloud version uses a name instead of a version number. The names of these versions use the names of London subway stations, and correspond to the version time sequence according to the order of the alphabet. For example, Angel is the first version, and Brixton is the second version. When the release content of SpringCloud reaches a critical point or a major bug is resolved, a "service releases" version, SRX version for short, will be released. For example, Greenwich.SR2 is the second SRX version of the Greenwich version released by SpringCloud.
But at present, it seems that springcloud has changed from the H version to the date-based version

Springcloud and springboot version comparison

insert image description here
Through the official website, we can see the version correspondence between springcloud and springboot.
Of course, the spirng official website also provides us with an official interface, which directly returns the version comparison result: https://start.spring.io/actuator/info
The returned result is in json Format it:
insert image description here

spirngcloud and springboot final selection

Some friends said that the latest version of boot is 2.7.3, and the latest version of cloud is 2021.0.3. Is it enough to choose this way?
No, the latest is not necessarily the best, we can also get it from the Internet. Find a more suitable one:
insert image description here
Click to view the version document:
insert image description here
you can see spirngcloud2021.0.3, and the official most recommended version is spirngboot2.6.8
, so we can follow the official recommendation

3: SpringCloudAlibab version selection

We have already selected the versions of springcloud and boot. If we want to join the springcloudlibab framework, we must reconsider the version number of the alibab framework. Fortunately, alibaba is open sourced by Ali, and the api is also in Chinese, which is very easy to understand Visit address
: https ://github.com/alibaba/spring-cloud-alibaba/wiki/ Version description
insert image description here
As we said above, springcloud has changed the version naming method since the H version, so spirngcloudAlibab has also changed the method, which can be said to be very Caring; Give Ali a heart, at least this is the most clear version description I have seen, at least it is in Chinese;

4: Check the version of its components (Sentinel, Nacos, etc.) corresponding to the Spring-Cloud-Alibaba version. Note: it must be corresponding, otherwise there will be some incompatibility problems

We said before that spring never reinvents the wheel. It integrates various technologies into a large ecological environment, so we also need to check the version numbers of other components of springcloudAlibab to avoid incompatibility problems in subsequent development. Access address:
https : //github.com/alibaba/spring-cloud-alibaba/wiki/Release Notes
insert image description here

5: Correspondence between mybatis and spring integration version reference

Mybatis official reference table: http://mybatis.org/spring/

mybatis Chinese official website: https://mybatis.org/mybatis-3/zh/

Click on the official reference table:
insert image description here
we can choose according to the JDK version, choose the required mybatis-spring-boot-starter version or mybatis version

You can also open the corresponding maven version of mybatis: https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter
for mybatis-spring-boot-starter version selection
insert image description here

6: mysql version selection

The official document address is: https://dev.mysql.com/doc/index-connectors.html
insert image description here
Of course, the version selection of mysql-connector-java still has to follow the version of the mysql database service, at least until 2022, mysql5 .7 is not yet obsolete;

If your mysql is version 8.x (the latest version), and it is integrated with the springboot parent project, you don't need to manage it separately, because it contains


        <!-- Mysql Connector -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

7:Druid:druid-spring-boot-starter版本

maven: https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter
Just select a suitable newer version number from the maven document

Because druid-spring-boot-starter is just an encapsulation based on druid, which is specially used to integrate spring-boot projects;
if the springboot project wants to use druid, it is also possible, but it needs to manually write configuration classes and inject them into beans, and Load the corresponding configuration parameters; but it is not recommended, obviously there is a ready-made packaged jar, just use it directly! ! !
So we directly introduce druid-spring-boot-starter instead of pure druid

		<!--Druid-->
		<!--可以不配这个因为druid-spring-boot-starter里面已经有了,随便带着一下这个依赖,代码可读性高一点,反正对其他啥也没影响-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.2.8</version>
        </dependency>

        <!--    Druid Spring Boot 组件-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.2.8</version>
        </dependency>

Guess you like

Origin blog.csdn.net/qq_41694906/article/details/126650189