|
1 | 1 | = Spring Data - Release Train BOM example
|
2 | 2 |
|
3 |
| -This project shows the usage of the Spring Data release train in a non-Spring-Boot project. It basically consists of the `pom.xml` with the following noteworthy sections: |
| 3 | +This project shows the usage of the Spring Data release train in a non-Spring-Boot project with both Maven and Gradle. |
4 | 4 |
|
5 |
| -- the `<properties />` element has properties for both the Spring and Spring Data. For Spring Framework we use a plain version, for Spring Data we name the release train release. The names for that follow the following convention: |
| 5 | +== Properties |
| 6 | + |
| 7 | +In both Maven and Gradle a couple of properties are used to define the versions of Spring Framework and Spring Data to use. For Spring Framework a plain version is used. For Spring Data we refer to a particular revision of a release train. The naming of Spring Data releases uses the following conventions: |
6 | 8 |
|
7 | 9 | ** `${release-train}-M1` -> Milestones
|
8 | 10 | ** …
|
9 | 11 | ** `${release-train}-RC1` -> Release candidate
|
10 | 12 | ** …
|
11 | 13 | ** `${release-train}-RELEASE` -> GA version
|
12 | 14 | ** `${release-train}-SR1` -> Services release (bugfixes) for that release train
|
13 |
| -** … |
14 | 15 |
|
15 |
| -- the `<dependencyManagement />` section now declares dependencies to the BOMs for both Spring and Spring Data, using the import scope and pom type. |
16 |
| -- the standard `<dependencies />` section can now list Spring and Spring Data dependencies without declaring a version and still be sure all libraries are in matching versions. |
| 16 | +== Maven |
| 17 | + |
| 18 | +The `<dependencyManagement />` section declares dependencies to the BOMs for both Spring and Spring Data, using the `import` scope and `pom` type. |
| 19 | + |
| 20 | +The standard `<dependencies />` section can now list Spring Framework and Spring Data dependencies without declaring a version and still be sure all libraries are in matching versions. |
| 21 | + |
| 22 | +Note, that we don't declare a Spring Framework dependency here. The import of the Spring Framework BOM nonetheless makes sure we control the version of all transitive Spring Framework dependencies pulled in by the Spring Data modules. |
| 23 | + |
| 24 | +== Gradle |
| 25 | + |
| 26 | +Gradle does not support Maven BOMs out of the box so the first thing to do is to declare a buildscript dependency on the https://github.com/spring-gradle-plugins/dependency-management-plugin[dependency management plugin] and apply it to the project. |
| 27 | + |
| 28 | +With the plugin applied, the `dependencyManagement` section can be used to import the Spring Framework and Spring Data BOMs. |
| 29 | + |
| 30 | +The standard `dependencies` section can now list Spring and Spring Data dependencies without declaring a version and still be sure all libraries are in matching versions. |
17 | 31 |
|
18 |
| -Note, that we don't declare a Spring dependency here. Declaring the BOM nonetheless makes sure we control the version of all transitive Spring dependencies pulled in by the Spring Data modules. |
| 32 | +Note, that we don't declare a Spring Framework dependency here. The dependency management plugin and Spring Framework BOM nonetheless makes sure we control the version of all transitive Spring Framework dependencies pulled in by the Spring Data modules. |
0 commit comments