我应该在弹簧靴,弹簧BOM和弹簧IO中使用哪一个?

Vir*_*raj 10 spring spring-boot

我试着阅读有关Spring BOM,Spring Boot和Spring IO的文档.
但是没有澄清,我们应该如何一起使用它们?
在我的项目中,我们已经拥有了自己的父POM
,所以我不能使用它们作为父项,但它们都有其他使用方式,如下所示定义依赖项管理

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>${org.springframework-version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
         <dependency>
             <!-- Import dependency management from Spring Boot -->
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>1.2.5.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
Run Code Online (Sandbox Code Playgroud)

弹簧BOM,Spring Boot和Spring IO解决了你需要的版本
那么它们之间究竟有什么区别呢?我应该选择哪一个?在哪种情况下?

And*_*son 19

Spring Framework bom为所有Spring Framework的模块提供依赖管理.Spring Boot bom是这个的超集.除了为Spring Framework提供依赖关系管理之外,它还为Spring Boot的模块,许多其他Spring项目以及Spring Boot支持的各种第三方依赖项提供依赖关系管理.反过来,Spring IO Platform bom是Spring Boot bom的超集.主要的变化是它为所有Spring项目的依赖项添加了依赖项管理.

如果您没有使用Spring Boot,或者您想使用自己的依赖关系管理,那么您可能希望使用Spring Framework bom.如果你正在使用Spring Boot,或者你想要一些依赖管理的帮助,那么你应该选择使用Spring Boot的bom还是Spring IO Platform bom.这里的主要选择是你想要的前缘有多接近.如果您喜欢最新版本,请使用Spring Boot bom.如果您的项目更加保守并且向后兼容性至关重要,那么您应该考虑使用Spring IO平台.

  • 您写道,Spring IO 是 Spring Boot 的超集。那么,为什么使用 Spring IO 比使用 Spring Boot 更保守呢?如果我升级 Spring IO,那么更多的库将会改变,并且可能我会有更多的编译错误。 (3认同)