Spring boot does not enforce the use of special dependencies. But it provides some very efficient dependencies. Among them are the following:
- Spring-boot-starter-parent
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> <relativePath/> </parent>
Spring-boot-starter-parent This is a dependency manager Pom file. Its role is to manage all the dependencies that boot requires, thereby unifying the version numbers of the various jars and avoiding the problem of version inconsistencies. So, by introducing other dependencies, you can omit the version number. Of course, you can also add the specified version number to replace the default.
-
Spring-cloud-dependencies
<dependencyManagement> <dependencies> <dependency& Gt <groupId>org.springframework.cloud</groupId> <artifactid>spring-cloud-dependencies</artifa Ctid> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies></dependencymanagement>
Spring-cloud-dependencies is also a dependency manager Pom file, as is the case with Spring-boot-starter-parent, The difference is that spring-cloud-dependencies is a reliance on cloud management. such as: Spring-cloud-starter-config, Spring-cloud-starter-netflix-eureka-server
Spring-boot-starter-web
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>
The spring-boot-starter-web is automatically embedded in the Tomcat container. At the same time, Springboot will also be configured according to the dependency in the classpath. For example: Spring-boot-starter-web will automatically assemble Tomcat containers , and the configuration of the Web app is automatically read from application.properties, such as: Server.port, or if the application.properties does not have the relevant parameters configured, the default configuration information, such as: 8080.
- SPRING-BOOT-STARTER-DATA-JPA the dependency of the database connection.
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId></dependency>
SPRING-BOOT-STARTER-DATA-JPA the dependency of the database connection.
Spring-cloud-config-server
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId></dependency>
Spring-cloud-config-server Configuration Center;
- Spring-cloud-starter-netflix-eureka-server
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency>
Spring-cloud-starter-netflix-eureka-server Registration Center. Is the core architecture of Spring cloud.
Description: A series of spring-boot-starter- and spring-cloud-starter- dependencies provided by spring boot are, in fact, a dependency-dependent integration that introduces multiple corresponding jars by introducing a start dependency. It is also important to note that spring boot provides starter that start with spring-boot-starter- and spring-cloud-starter- , and if you want to customize starter, The naming format should be: *-spring-boot-starter.
Spring Boot dependencies