【问题标题】:spring cloud version Brixton.SR5 with spring boot 1.4spring cloud 版本 Brixton.SR5 with spring boot 1.4
【发布时间】:2017-01-09 20:39:52
【问题描述】:

我有一个新项目,我们正在使用 spring Brixton.SR1... Brixton.SR1 或 SR5 是基于 1.3.5.RELEASE 构建的,但论坛说它已经过 1.4.0.RELEASE 测试,因此我想使用 1.4.0 的一些功能。

 <dependencyManagement>
    <dependencies>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-parent</artifactId>
            <version>Brixton.SR1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
 ..
 </dependencyManagement>

然后我们正在添加依赖项,并且使用所有默认版本,例如.. spring boot 是 1.3.5.RELEASE,因此当前结构如下所示。

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-autoconfigure</artifactId>
    </dependency>
 ....

但我想使用 1.4.0 。我可以排除 1.3.5 版本并使用这个新版本....而且我不想为所有 Spring Boot 工件覆盖它。例如..如下所示

  <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-autoconfigure</artifactId>
        <version>1.4.0.RELEASE</version>
</dependency>

等等……

宁愿为 spring-boot 工件提供一个通用版本,并且应该为所有 spring 工件提供默认版本为 1.4.0

【问题讨论】:

    标签: spring maven spring-boot spring-cloud


    【解决方案1】:

    只需将 spring boot 的 1.4 bom 和 spring cloud 的 bom 导入你的 pom.xml:

    <dependencyManagement>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>1.4.0.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Brixton.SR5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    

    【讨论】:

      猜你喜欢
      • 2015-09-20
      • 2021-12-16
      • 2021-04-04
      • 2016-12-16
      • 2021-07-27
      • 1970-01-01
      • 2016-10-29
      • 2020-11-01
      • 1970-01-01
      相关资源
      最近更新 更多