Skip to content

Commit c5b9d7f

Browse files
committed
Move MongoDB Docker Compose support into spring-boot-mongodb
1 parent 1955681 commit c5b9d7f

File tree

10 files changed

+30
-7
lines changed

10 files changed

+30
-7
lines changed

spring-boot-project/spring-boot-docker-compose-all/src/main/resources/META-INF/spring.factories

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
33
org.springframework.boot.docker.compose.service.connection.clickhouse.ClickHouseR2dbcDockerComposeConnectionDetailsFactory,\
44
org.springframework.boot.docker.compose.service.connection.mariadb.MariaDbR2dbcDockerComposeConnectionDetailsFactory,\
5-
org.springframework.boot.docker.compose.service.connection.mongo.MongoDockerComposeConnectionDetailsFactory,\
65
org.springframework.boot.docker.compose.service.connection.mysql.MySqlR2dbcDockerComposeConnectionDetailsFactory,\
76
org.springframework.boot.docker.compose.service.connection.neo4j.Neo4jDockerComposeConnectionDetailsFactory,\
87
org.springframework.boot.docker.compose.service.connection.oracle.OracleFreeR2dbcDockerComposeConnectionDetailsFactory,\

spring-boot-project/spring-boot-mongodb/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id "org.springframework.boot.auto-configuration"
44
id "org.springframework.boot.configuration-properties"
55
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.docker-test"
67
id "org.springframework.boot.optional-dependencies"
78
}
89

@@ -11,6 +12,7 @@ description = "Spring Boot MongoDB"
1112
dependencies {
1213
api(project(":spring-boot-project:spring-boot"))
1314
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
15+
optional(project(":spring-boot-project:spring-boot-docker-compose"))
1416
optional(project(":spring-boot-project:spring-boot-reactor"))
1517
optional(project(":spring-boot-project:spring-boot-testcontainers"))
1618
optional("io.netty:netty-transport")
@@ -20,6 +22,9 @@ dependencies {
2022
}
2123

2224
dependencies {
25+
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
26+
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
27+
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-docker-compose")))
2328
testImplementation(project(":spring-boot-project:spring-boot-test"))
2429
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
2530
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-testcontainers")))

spring-boot-project/spring-boot-docker-compose-all/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoDockerComposeConnectionDetailsFactoryIntegrationTests.java renamed to spring-boot-project/spring-boot-mongodb/src/dockerTest/java/org/springframework/boot/mongodb/docker/compose/MongoDockerComposeConnectionDetailsFactoryIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.docker.compose.service.connection.mongo;
17+
package org.springframework.boot.mongodb.docker.compose;
1818

1919
import com.mongodb.ConnectionString;
2020
import org.junit.jupiter.api.condition.OS;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
mongo:
3+
image: '{imageName}'
4+
ports:
5+
- '27017'
6+
environment:
7+
- 'MONGODB_ROOT_USERNAME=root'
8+
- 'MONGODB_ROOT_PASSWORD=secret'
9+
- 'MONGODB_DATABASE=testdb'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
mongo:
3+
image: '{imageName}'
4+
ports:
5+
- '27017'
6+
environment:
7+
MONGO_INITDB_ROOT_USERNAME: 'root'
8+
MONGO_INITDB_ROOT_PASSWORD: 'secret'
9+
MONGO_INITDB_DATABASE: 'mydatabase'

spring-boot-project/spring-boot-docker-compose-all/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoDockerComposeConnectionDetailsFactory.java renamed to spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/docker/compose/MongoDockerComposeConnectionDetailsFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.docker.compose.service.connection.mongo;
17+
package org.springframework.boot.mongodb.docker.compose;
1818

1919
import com.mongodb.ConnectionString;
2020

spring-boot-project/spring-boot-docker-compose-all/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoEnvironment.java renamed to spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/docker/compose/MongoEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.docker.compose.service.connection.mongo;
17+
package org.springframework.boot.mongodb.docker.compose;
1818

1919
import java.util.Map;
2020

spring-boot-project/spring-boot-docker-compose-all/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/package-info.java renamed to spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/docker/compose/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*/
1616

1717
/**
18-
* Auto-configuration for Docker Compose MongoDB service connections.
18+
* Support for Docker Compose MongoDB service connections.
1919
*/
20-
package org.springframework.boot.docker.compose.service.connection.mongo;
20+
package org.springframework.boot.mongodb.docker.compose;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Connection Details Factories
22
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
3+
org.springframework.boot.mongodb.docker.compose.MongoDockerComposeConnectionDetailsFactory,\
34
org.springframework.boot.mongodb.testcontainers.MongoContainerConnectionDetailsFactory

spring-boot-project/spring-boot-docker-compose-all/src/test/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoEnvironmentTests.java renamed to spring-boot-project/spring-boot-mongodb/src/test/java/org/springframework/boot/mongodb/docker/compose/MongoEnvironmentTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.docker.compose.service.connection.mongo;
17+
package org.springframework.boot.mongodb.docker.compose;
1818

1919
import java.util.Collections;
2020
import java.util.Map;

0 commit comments

Comments
 (0)