From 6f5bd2e13a6698e7094c3ca6fd4fb5321563eb8d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 26 May 2016 13:48:46 +0100 Subject: [PATCH] Upgrade to MongoDB 3 This commit upgrades to MongoDB 3. Dependency management has been added for the new and preferred mongodb-driver artifact. The starter has been updated to use this new artifact rather than monogo-java-driver. Dependency management for mongo-java-driver has been retained to avoid causing problems for people who have declared the dependency explicitly. The auto-configuration for Embedded Mongo has also been updated to use 3.2.2 by default. Closes gh-3011 --- .../mongo/embedded/EmbeddedMongoProperties.java | 2 +- .../embedded/EmbeddedMongoAutoConfigurationTests.java | 2 +- spring-boot-dependencies/pom.xml | 7 ++++++- .../spring-boot-starter-data-mongodb/pom.xml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoProperties.java index 6255c3b96a..9b6c1fd4b2 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoProperties.java @@ -37,7 +37,7 @@ public class EmbeddedMongoProperties { /** * Version of Mongo to use. */ - private String version = "2.6.10"; + private String version = "3.2.2"; private final Storage storage = new Storage(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java index 1b705158d2..18542612f2 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java @@ -61,7 +61,7 @@ public class EmbeddedMongoAutoConfigurationTests { @Test public void defaultVersion() { - assertVersionConfiguration(null, "2.6.10"); + assertVersionConfiguration(null, "3.2.2"); } @Test diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 77784031fb..6658310e82 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -125,7 +125,7 @@ 1.16.8 1.4.4 1.10.19 - 2.14.2 + 3.2.2 5.1.39 5.3.2.Final 1.9.22 @@ -1893,6 +1893,11 @@ mockito-core ${mockito.version} + + org.mongodb + mongodb-driver + ${mongodb.version} + org.mongodb mongo-java-driver diff --git a/spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml b/spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml index 535fdf579c..5584f5ea14 100644 --- a/spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml +++ b/spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml @@ -25,7 +25,7 @@ org.mongodb - mongo-java-driver + mongodb-driver org.springframework.data