我正在用 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 Artifact 覆盖它。例如..如下所示
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>1.4.0.RELEASE</version>
</dependency>
等等等等..
希望有一个 spring-boot Artifact 的通用版本,并且应该为所有 spring Artifact 提供默认版本 1.4.0
最佳答案
只需将 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>
关于带有 Spring Boot 1.4 的 Spring Cloud 版本 Brixton.SR5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39280389/