SpringBoot与SpringCloud的版本对应详细版

大版本对应:

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长这样:

1<project xmlns="http://maven.apache.org/POM/4.0.0" 2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4 <modelVersion>4.0.0</modelVersion> 5 <groupId>com.joyce</groupId> 6 <artifactId>joyce-test</artifactId> 7 <version>1.0</version> 8 <packaging>jar</packaging> 9 10 <parent> 11 <groupId>org.springframework.boot</groupId> 12 <artifactId>spring-boot-starter-parent</artifactId> 13 <version>1.5.9.RELEASE</version> 14 <relativePath /> 15 </parent> 16 17 <dependencyManagement> 18 <dependencies> 19 <dependency> 20 <groupId>org.springframework.cloud</groupId> 21 <artifactId>spring-cloud-dependencies</artifactId> 22 <version>Edgware.RELEASE</version> 23 <type>pom</type> 24 <scope>import</scope> 25 </dependency> 26 </dependencies> 27 </dependencyManagement> 28 29 <properties> 30 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 31 </properties> 32 33 <dependencies> 34 <dependency> 35 <groupId>org.springframework.cloud</groupId> 36 <artifactId>spring-cloud-starter-feign</artifactId> 37 </dependency> 38 <dependency> 39 <groupId>org.springframework.cloud</groupId> 40 <artifactId>spring-cloud-starter-hystrix</artifactId> 41 </dependency> 42 <dependency> 43 <groupId>org.springframework.cloud</groupId> 44 <artifactId>spring-cloud-starter-zipkin</artifactId> 45 </dependency> 46 <dependency> 47 <groupId>org.springframework.cloud</groupId> 48 <artifactId>spring-cloud-starter-eureka</artifactId> 49 </dependency> 50 <dependency> 51 <groupId>org.springframework.boot</groupId> 52 <artifactId>spring-boot-starter-actuator</artifactId> 53 </dependency> 54 <dependency> 55 <groupId>org.springframework.boot</groupId> 56 <artifactId>spring-boot-starter-web</artifactId> 57 <exclusions> 58 <!-- 排除spring boot默认使用的tomcat,使用jetty --> 59 <exclusion> 60 <groupId>org.springframework.boot</groupId> 61 <artifactId>spring-boot-starter-tomcat</artifactId> 62 </exclusion> 63 </exclusions> 64 </dependency> 65 <dependency> 66 <groupId>org.springframework.boot</groupId> 67 <artifactId>spring-boot-starter-jetty</artifactId> 68 </dependency> 69 <dependency> 70 <groupId>org.springframework.cloud</groupId> 71 <artifactId>spring-cloud-starter-ribbon</artifactId> 72 </dependency> 73 <dependency> 74 <groupId>org.springframework.boot</groupId> 75 <artifactId>spring-boot-starter-test</artifactId> 76 <scope>test</scope> 77 </dependency> 78 </dependencies> 79</project>

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

1import org.junit.Test; 2import org.junit.runner.RunWith; 3import org.slf4j.LoggerFactory; 4import org.springframework.beans.factory.annotation.Autowired; 5import org.springframework.boot.test.context.SpringBootTest; 6import org.springframework.test.context.junit4.SpringRunner; 7import org.springframework.web.client.RestTemplate; 8 9@RunWith(SpringRunner.class) 10@SpringBootTest(classes=MyApplication.class) 11public class MyApplicationTest { 12 private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(MyApplicationTest.class); 13 14 @Autowired 15 private RestTemplate restTemplate; 16 @Test 17 public void test() { 18 System.out.println("ok!!!"); 19 } 20 @Test 21 public void orderName() { 22 try { 23 String name = "joyce"; 24 String rr = restTemplate.getForObject("http://joyce-user/orderName?name="+name, String.class); 25 LOG.info("rr====" + rr); 26 } catch (Exception e) { 27 e.printStackTrace(); 28 } 29 } 30 31}

点赞
收藏

评论区

加载中...

相关推荐

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

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

Intellij Idea启动springboot报ClassNotFoundException

IntellijIdea版本为Ultimate2016.1,gradle版本为3.5,启动springboot报错java.lang.NoClassDefFoundError:org/springframework/boot/SpringApplicationatcom.some.fancy.name.Applicat

SpringCloud的版本

SpringCloud项目目前仍然是快速迭代期,版本变化很快。这里整理一下版本相关的东西,备忘一下。大版本版本号规则SpringCloud并没有熟悉的数字版本号,而是对应一个开发代号。Cloud代号Boot版本(train)Boot版本(tested)lifecycleAngle1.2.xinco

VBox 启动虚拟机失败

在Vbox(5.0.8版本)启动Ubuntu的虚拟机时,遇到错误信息:NtCreateFile(\\Device\\VBoxDrvStub)failed:0xc000000034STATUS\_OBJECT\_NAME\_NOT\_FOUND(0retries) (rc101)Makesurethekern