美文网首页
SpringCloud 和套件的版本控制

SpringCloud 和套件的版本控制

作者: 黄靠谱 | 来源:发表于2019-07-11 19:06 被阅读0次

概述

都是根据大的版本号,来找适配的套件的版本号
两种方法

  1. 根据dependencyManagement里面的spring-cloud-dependencies

  2. 参考套件train
    https://spring.io/projects/spring-cloud

具体步骤

  1. 配置springboot的版本
  2. 引入对于 SpringCloud 的dependencyManagement
  3. 引入里面配置的相关套件(不需要配置版本号)

比如主版本选择 2.0.6的SpringBoot,对于的SC的大版本号是Finchley.SR2 ,要引用 feign,则需要进入dependencyManagement 查看对应的feign的依赖是 openfeign


    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.6.RELEASE</version>
        <relativePath/> 
    </parent>
    
    <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Finchley.SR2</spring-cloud.version>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
            <version>0.2.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

dependencyManagement 进去看对应Finchley.SR2 里面集成的 feign的依赖

    <parent>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies-parent</artifactId>
        <version>2.0.4.RELEASE</version>
        <relativePath/>
    </parent>
    <artifactId>spring-cloud-dependencies</artifactId>
    <version>Finchley.SR2</version>
    <name>spring-cloud-dependencies</name>
    <description>Spring Cloud Dependencies</description>
    <packaging>pom</packaging>
    <properties>
        <main.basedir>${basedir}/../..</main.basedir>
        <spring-cloud-aws.version>2.0.1.RELEASE</spring-cloud-aws.version>
        <spring-cloud-bus.version>2.0.0.RELEASE</spring-cloud-bus.version>
        <spring-cloud-cloudfoundry.version>2.0.1.RELEASE</spring-cloud-cloudfoundry.version>
        <spring-cloud-commons.version>2.0.2.RELEASE</spring-cloud-commons.version>
        <spring-cloud-config.version>2.0.2.RELEASE</spring-cloud-config.version>
        <spring-cloud-consul.version>2.0.1.RELEASE</spring-cloud-consul.version>
        <spring-cloud-contract.version>2.0.2.RELEASE</spring-cloud-contract.version>
        <spring-cloud-function.version>1.0.0.RELEASE</spring-cloud-function.version>
        <spring-cloud-gateway.version>2.0.2.RELEASE</spring-cloud-gateway.version>
        <spring-cloud-netflix.version>2.0.2.RELEASE</spring-cloud-netflix.version>
        <spring-cloud-openfeign.version>2.0.2.RELEASE</spring-cloud-openfeign.version>
        <spring-cloud-security.version>2.0.1.RELEASE</spring-cloud-security.version>
        <spring-cloud-sleuth.version>2.0.2.RELEASE</spring-cloud-sleuth.version>
        <spring-cloud-stream.version>Elmhurst.SR1</spring-cloud-stream.version>
        <spring-cloud-task.version>2.0.0.RELEASE</spring-cloud-task.version>
        <spring-cloud-vault.version>2.0.2.RELEASE</spring-cloud-vault.version>
        <spring-cloud-zookeeper.version>2.0.0.RELEASE</spring-cloud-zookeeper.version>
    </properties>

相关文章

网友评论

      本文标题:SpringCloud 和套件的版本控制

      本文链接:https://www.haomeiwen.com/subject/slhjkctx.html