diff --git a/README.md b/README.md index 32680a17..492de269 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,5 @@ We have separate folders for the samples of individual modules: ## Miscellaneous +* `bom` - Example project how to use the Spring Data release train bom in non-Spring-Boot scenarios. * `multi-store` - Example project to use both Spring Data MongoDB and Spring Data JPA in one project. \ No newline at end of file diff --git a/bom/README.adoc b/bom/README.adoc new file mode 100644 index 00000000..86d18b15 --- /dev/null +++ b/bom/README.adoc @@ -0,0 +1,18 @@ += Spring Data - Release Train BOM example + +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: + +- the `` 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: + +** `${release-train}-M1` -> Milestones +** … +** `${release-train}-RC1` -> Release candidate +** … +** `${release-train}-RELEASE` -> GA version +** `${release-train}-SR1` -> Services release (bugfixes) for that release train +** … + +- the `` section now declares dependencies to the BOMs for both Spring and Spring Data, using the import scope and pom type. +- the standard `` section can now list Spring and Spring Data dependencies without declaring a version and still be sure all libraries are in matching versions. + +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. \ No newline at end of file diff --git a/bom/pom.xml b/bom/pom.xml new file mode 100644 index 00000000..29dba5c2 --- /dev/null +++ b/bom/pom.xml @@ -0,0 +1,53 @@ + + 4.0.0 + + org.springframework.data.examples + spring-data-examples-bom + 1.0.0.BUILD-SNAPSHOT + + Spring Data - Using the BOM for dependency management + + + 4.1.6.RELEASE + Fowler-RELEASE + + + + + + + org.springframework + spring-framework-bom + ${spring.version} + import + pom + + + + org.springframework.data + spring-data-releasetrain + ${spring-data.version} + import + pom + + + + + + + + + + org.springframework.data + spring-data-rest-webmvc + + + + org.springframework.data + spring-data-mongodb + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 9216ddba..21fc0803 100644 --- a/pom.xml +++ b/pom.xml @@ -26,6 +26,7 @@ cassandra elasticsearch web + bom