About dependency
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>{springBootVersion}</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
By rooting the project in the parent starter, the build can take advantage of Maven dependency
management to inherit dependency versions for several commonly used libraries so that you don’t
have to explicitly specify the versions when declaring dependencies.
The versions of the starter dependencies themselves are determined by the version of Spring Boot
you’re using. The starter dependencies themselves determine the versions of the various transitive
dependencies that they pull in.
Exclude:
If you’re using Gradle, you can exclude transitive dependencies like this:
compile("org.springframework.boot:spring-boot-starter-web") {
exclude group: 'com.fasterxml.jackson.core'
}
In Maven, you can exclude transitive dependencies with the <exclusions> element.
The following <dependency> for the Spring Boot web starter has <exclusions> to
keep Jackson out of the build:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
</exclusions>
</dependency>
Maven always favors the closest dependency, meaning that because you’ve expressed
this dependency in your project’s build, it will be favored over the one that’s transitively referred to by
another dependency.