大版本对应:

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信息:

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();
}
} }

SpringBoot与SpringCloud的版本对应详细版的更多相关文章

  1. SpringBoot 与 SpringCloud 的版本对应详细信息

    "spring-cloud": { "Finchley.M2": "Spring Boot >=2.0.0.M3 and <2.0.0.M ...

  2. SpringBoot和SpringCloud的版本对应关系

    1.详细的SpringBoot和SpringCloud对应的关系: Spring官方对应关系 2.springCloud与各组件的版本对应关系 官方文档

  3. springboot与springcloud的版本问题

    Spring Cloud为开发者提供了一套可以用来快速搭建分布式系统中常见模式的工具.提取主干即是Spring Cloud提供了一套工具.这些工具为开发人员提供了分布式系统下常见问题的通用解决方案.这 ...

  4. SpringBoot 整合 Mybatis 和 Mysql (详细版)

    结构如下 1.引入相关依赖 <!--mysql--><dependency> <groupId>mysql</groupId> <artifact ...

  5. springboot集成springcloud,启动时报错java.lang.AbstractMethodError: null

    出现这个问题是springboot和springcloud的版本不匹配. 我此处使用了springboot 2.0.4.RELEASE,springcloud 使用了Finchley.SR2. 修改方 ...

  6. springboot与springcloud版本不对应导致报错java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V

    springboot启动报错: 10:31:50.221 [main] ERROR org.springframework.boot.SpringApplication - Application r ...

  7. SpringBoot整合Mybatis完整详细版

    记得刚接触SpringBoot时,大吃一惊,世界上居然还有这么省事的框架,立马感叹:SpringBoot是世界上最好的框架.哈哈! 当初跟着教程练习搭建了一个框架,传送门:spring boot + ...

  8. springboot和springcloud版本上的选择

    现在的springboot项目和cloud版本都是更新很快,但我们开发不是版本越新越好,我们要把版本对应起来,那么我们怎么去关联呢? springboot和springcloud不是越新越好,clou ...

  9. SpringBoot整合Mybatis完整详细版二:注册、登录、拦截器配置

    接着上个章节来,上章节搭建好框架,并且测试也在页面取到数据.接下来实现web端,实现前后端交互,在前台进行注册登录以及后端拦截器配置.实现简单的未登录拦截跳转到登录页面 上一节传送门:SpringBo ...

随机推荐

  1. if ,while ,for 的掌握

    a)python的缩进和冒号 对于Python而言代码缩进是一种语法,Python没有像其他语言一样采用{}或者begin...end分隔代码块,而是采用代码缩进和冒号来区分代码之间的层次. 缩进的空 ...

  2. sqlite比较时间秒

    julianday(datetime('now','localtime'))*86400 -julianday("你的时间字段")*86400>0

  3. 中文dumps显示

    json.dumps(tuwen_attention_dict_set, ensure_ascii=False)

  4. SpringJPA主键生成采用自定义ID,自定义ID采用年月日时间格式

    自定义主键生成策略 在entity类上添加注解 @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "custom ...

  5. 使用min-device-pixel-ratio媒体功能实现真正的1像素border

    关于设备像素比的知识,想必做过移动端开发的都有接触,这里就不介绍啦,万一有不懂的可以看张鑫旭大神的设备像素比devicePixelRatio简单介绍 由于设备像素比存在的原因,我们在处理设计图的一些边 ...

  6. mysql的常用操作

    基本操作 #1 操作文件夹(库) 增 create database db1 charset utf8; --指定格式为utf8 查 show databases; --查看所有的数据库 show c ...

  7. C# 枚举用法

    public static class EnumExtensions { public static string GetDescription(this Enum value) { return v ...

  8. HOMEWORD2

    开发工具和语言选择 语言 :pyhton3.6 工具 我选择的是 pycharm2019.1.由于之前已经安装好了,这里就不再贴出. 自动单元测试练习 python单元测试框架Unittest.Uni ...

  9. 将连接数据库的JDBC提成BaseDao

    package com.shangke; import java.io.FileReader;import java.io.IOException;import java.io.InputStream ...

  10. anaconda的python版本与本地python版本不同时的问题

    在用anaconda,尤其是win下的时候,本地的python版本可能和虚拟环境中需要的python版本不同,而在虚拟环境中使用pip3安装包的时候,仍会出现版本是本地的python版本的情况,虽然并 ...