Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring: spring-data-mongodb or spring-boot-starter-data-mongodb

Which's the difference between

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-mongodb</artifactId>
</dependency>

and,

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

I'm developing an spring boot service.

like image 816
Jordi Avatar asked Sep 20 '18 13:09

Jordi


2 Answers

spring-boot-starter-data-mongodb contains configuration classes for Spring Boot. It also includes the spring-data-mongodb library so you would only need to include the start in your boot app:

https://search.maven.org/artifact/org.springframework.boot/spring-boot-starter-data-mongodb/2.0.5.RELEASE/jar

like image 71
Mike Avatar answered Oct 22 '22 23:10

Mike


spring-boot-starter-data-mongodb is a spring boot starter pom. For more information on starters: spring-boot-starters

Dependency management is a critical aspects of any complex project. And doing this manually is less than ideal; the more time you spent on it the less time you have on the other important aspects of the project.

Spring Boot starters were built to address exactly this problem. Starter POMs are a set of convenient dependency descriptors that you can include in your application. You get a one-stop-shop for all the Spring and related technology that you need, without having to hunt through sample code and copy paste loads of dependency descriptors.

like image 2
Sukhpal Singh Avatar answered Oct 23 '22 00:10

Sukhpal Singh