diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/collection/name/SpringBootCollectionNameApplication.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/collection/name/SpringBootCollectionNameApplication.java index e4157b6a53..09b5a8ef17 100644 --- a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/collection/name/SpringBootCollectionNameApplication.java +++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/collection/name/SpringBootCollectionNameApplication.java @@ -2,11 +2,12 @@ package com.baeldung.boot.collection.name; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.PropertySource; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; -@SpringBootApplication +@SpringBootApplication(exclude = EmbeddedMongoAutoConfiguration.class) @PropertySource("classpath:boot.collection.name/app.properties") @EnableMongoRepositories(basePackages = { "com.baeldung.boot.collection.name" }) public class SpringBootCollectionNameApplication { diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/composite/key/SpringBootCompositeKeyApplication.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/composite/key/SpringBootCompositeKeyApplication.java index 1322adbf77..14c88d3ec7 100644 --- a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/composite/key/SpringBootCompositeKeyApplication.java +++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/composite/key/SpringBootCompositeKeyApplication.java @@ -2,9 +2,10 @@ package com.baeldung.boot.composite.key; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; -@SpringBootApplication +@SpringBootApplication(exclude = EmbeddedMongoAutoConfiguration.class) @EnableMongoRepositories(basePackages = { "com.baeldung.boot.composite.key" }) public class SpringBootCompositeKeyApplication { public static void main(String... args) { diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/count/SpringBootCountApplication.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/count/SpringBootCountApplication.java index bb7351383c..cb90544a33 100644 --- a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/count/SpringBootCountApplication.java +++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/count/SpringBootCountApplication.java @@ -2,9 +2,10 @@ package com.baeldung.boot.count; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; -@SpringBootApplication +@SpringBootApplication(exclude = EmbeddedMongoAutoConfiguration.class) @EnableMongoRepositories(basePackages = { "com.baeldung.boot.count" }) public class SpringBootCountApplication { public static void main(String... args) { diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/unique/field/SpringBootUniqueFieldApplication.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/unique/field/SpringBootUniqueFieldApplication.java index 648ecd4dfb..de983c08ff 100644 --- a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/unique/field/SpringBootUniqueFieldApplication.java +++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/boot/unique/field/SpringBootUniqueFieldApplication.java @@ -2,10 +2,11 @@ package com.baeldung.boot.unique.field; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration; import org.springframework.context.annotation.PropertySource; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; -@SpringBootApplication +@SpringBootApplication(exclude = EmbeddedMongoAutoConfiguration.class) @PropertySource("classpath:boot.unique.field/app.properties") @EnableMongoRepositories(basePackages = { "com.baeldung.boot.unique.field" }) public class SpringBootUniqueFieldApplication { diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/logging/SpringBootPersistenceApplication.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/logging/SpringBootPersistenceApplication.java deleted file mode 100644 index bcca23b714..0000000000 --- a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/logging/SpringBootPersistenceApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.logging; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class SpringBootPersistenceApplication { - - public static void main(String ... args) { - SpringApplication.run(SpringBootPersistenceApplication.class, args); - } - -}