SpringBoot与SpringCloud的版本对应详细版

Stella981
• 阅读 588

大版本对应:

Spring Boot

Spring Cloud

1.2.x

Angel版本

1.3.x

Brixton版本

1.4.x stripes

Camden版本

1.5.x

Dalston版本、Edgware版本

2.0.x

Finchley版本

2.1.x

Greenwich.SR2

在实际开发过程中,我们需要更详细的版本对应:Spring 官方对应版本地址:  (https://start.spring.io/actuator/info),建议用firefox浏览器打开,你会看见格式化好了json信息:

SpringBoot与SpringCloud的版本对应详细版

spring-cloud-dependencies 版本列表可查看:  

https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies

spring-boot-starter-parent 版本列表可查看:

https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent

在SpringCloud中,1.X和2.X版本在pom.xml中引入的jar包名字都不一样,比如有的叫spirng-cloud-starter-hystrix 有的叫spring-cloud-netflix-hystrix,维护起来会比较困难。

1.x版本pom.xml里几个基本用到的jar长这样:

<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.joyce</groupId>
    <artifactId>joyce-test</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
        <relativePath /> 
    </parent>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Edgware.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-feign</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <!-- 排除spring boot默认使用的tomcat,使用jetty -->
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-ribbon</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

在SpringBoot 1.5.9.RELEASE 版本中,junit测试类模版长这样:

import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.client.RestTemplate;

@RunWith(SpringRunner.class)
@SpringBootTest(classes=MyApplication.class)
public class MyApplicationTest {
    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(MyApplicationTest.class);
    
    @Autowired
    private RestTemplate restTemplate;
    @Test
    public void test() {
        System.out.println("ok!!!");
    }
    @Test
    public void orderName() {
        try {
            String name = "joyce";
            String rr = restTemplate.getForObject("http://joyce-user/orderName?name="+name, String.class);
            LOG.info("rr====" + rr);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
}

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Easter79 Easter79
2年前
SpringBoot与SpringCloud的版本对应详细版
大版本对应:SpringBootSpringCloud1.2.xAngel版本1.3.xBrixton版本1.4.xstripesCamden版本1.5.xDalston版本、Edgware版本2.0.xFinchley版本2.1.xGreenwich.SR2在实际开发过程中,我们需要更详
Stella981 Stella981
2年前
Intellij Idea启动springboot报ClassNotFoundException
IntellijIdea版本为Ultimate2016.1,gradle版本为3.5,启动springboot报错java.lang.NoClassDefFoundError:org/springframework/boot/SpringApplicationatcom.some.fancy.name.Applicat
Easter79 Easter79
2年前
SpringCloud的版本
SpringCloud项目目前仍然是快速迭代期,版本变化很快。这里整理一下版本相关的东西,备忘一下。大版本版本号规则SpringCloud并没有熟悉的数字版本号,而是对应一个开发代号。Cloud代号Boot版本(train)Boot版本(tested)lifecycleAngle1.2.xinco
Easter79 Easter79
2年前
TypeScript 4.0正式发布!现在是开始使用它的最佳时机
!(https://oscimg.oschina.net/oscnet/9d5dde21c00d49b6b148bfabfc93db57.jpg)作者|DanielRosenwasser译者|王强策划|李俊辰稿源|前端之巅微软宣布TypeScript4.0正式版上线了!这一新版本深入改进了表现力、生产力
Stella981 Stella981
2年前
Git push
我有两个不同版本的git。在1.6.2版本中,gitpush没有u选项。它只出现在1.7.x版本中。从文档中,u与变量相关branch.<name.merge在gitconfig。该变量如下所述:Defines,togetherwithbranch.<name.remot
Wesley13 Wesley13
2年前
VBox 启动虚拟机失败
在Vbox(5.0.8版本)启动Ubuntu的虚拟机时,遇到错误信息:NtCreateFile(\\Device\\VBoxDrvStub)failed:0xc000000034STATUS\_OBJECT\_NAME\_NOT\_FOUND(0retries) (rc101)Makesurethekern
Wesley13 Wesley13
2年前
MySQLStudy——Mac下MySQL 常用命令 启动 关闭 重启服务 查看版本
MAC下MySQL常用命令本人电脑为MacOS10.14版本MySQL为8.0.15版本查看mysql版本方法一:status;!(https://oscimg.oschina.net/oscnet/01e3f478
Wesley13 Wesley13
2年前
QQ玩一玩好友排行榜与世界排行榜
QQ玩一玩好友排行榜与世界排行榜1、开发环境CocosCreatorV2.0.5手Q版本V7.9.0.3820(目前市场中最新版本)qqPlayCore.jsbuildTime:'FriNov09201813:20:45GMT0800(GMT08:00)'上出现,
Stella981 Stella981
2年前
GitHub Actions
使用GitHubActions发布版本时,获取触发的tag作为发布的版本号.方式一通过step获取tag,在需要使用的地方使用steps.get_version.outputs.VERSION,其中get_version是step的id.name:Release