4

Spring Data Jpa Docs suggest to use Maven BOM (bill of materials) due to:

Due to different inception dates of individual Spring Data modules, most of them carry different major and minor version numbers. The easiest way to find compatible ones is by relying on the Spring Data Release Train BOM we ship with the compatible versions defined. In a Maven project you’d declare this dependency in the <dependencyManagement/> section of your POM

Reference to official example is provided.

I've got the idea of BOM and dependencyManagement. Vendor officially supply us (developers) with tested/recommended/supported compatibility list. That is great!

In order to move versions synchronously I need some "super-BOM" that governs following BOMs:

org.springframework:spring-framework-bom
org.springframework.data:spring-data-releasetrain
org.springframework.security:spring-security-bom

How do I choose compatible ones?

Are there SPRING-SUPER-BOM for all umbrella (I mean official or community supported so I save my time by avoiding troubleshooting and if that happen and I have found and have resolved issue - I have an option to get back solution to community)?

4

1 回答 1

4

感谢您向@jumping_monkey指出 Spring 平台弃用。

现在你应该继续org.springframework.boot:spring-boot-dependencies。这并不意味着您开始使用 Spring Boot。这仅意味着您正在使用 Spring Boot 托管的依赖管理!

所以你的构建文件看起来像:

apply plugin: 'io.spring.dependency-management'
dependencyManagement {
    imports {
        mavenBom "org.springframework.boot:spring-boot-starter-parent:${projSpringBootVersion}"
        mavenBom "org.springframework.cloud:spring-cloud-starter-parent:${projSpringCloudVersion}"
        mavenBom "org.springframework.cloud:spring-cloud-gcp-dependencies:${projSpringGcpVersion}"
    }
    applyMavenExclusions = false
}

spring-boot-starter-parent请注意, &的版本之间仍然存在不确定性spring-cloud-starter-parent。但没关系。至少它们有助于管理 Hibernate/Jeckson/whatever 的版本!

OLD感谢@M.Deinum指向Spring IO 平台

该项目提供各种 Spring 项目及其依赖项的版本。

可以在相应的http://docs.spring.io/platform/docs/https://github.com/spring-io/platform/blob/master/platform-b ​​om/pom.xml文件中检查实际依赖项查看不同的标签:https ://github.com/spring-io/platform/tags

使用本地 Git 克隆很容易做到这一点:

$ git clone https://github.com/spring-io/platform.git
$ cd platform/
$ git tag --list
$ git co v1.0.2.RELEASE
$ less platform-bom/pom.xml

但是您在这里没有找到 /// 的依赖spring-corespring-mvc,因为它们在父 pom中string-data,实际上也包括.spring-securityspring-boot-starter-parentspring-boot-dependencies

spring-boot-dependencies有版本和依赖

  • spring-framework-bom
  • spring-data-releasetrain
  • spring-security-bom
  • spring-integration-bom

因此,如果您的应用程序非常覆盖 - 您可以使用io.spring.platform:platform-bom. 但是,如果该列表过于复杂,只需使用org.springframework.boot:spring-boot-dependenciesas dependencyManagement

于 2015-12-17T11:53:38.040 回答