Spring Boot 2.X actual course (5) Construction system

5 . Build System

It is strongly recommended that you choose to support dependency management and can be used to publish "Maven Central" work repository of the build system . We recommend that you select Maven . 

5 .1 dependency management

Each version of the Spring Boot provides a selection list of dependencies it supports.

. 5 .2 using Maven Construction

Maven users from spring-boot-starter-parent inherited the project to obtain reasonable defaults.

5 .2.1 inherited Starter Parent

To configure the project to inherit the Spring-the Boot-Starter-parent , please set as follows : 

<-! Inherit Spring Boot defaults ->

<parent>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-parent</artifactId>

<version>2.1.6.RELEASE</version>

</parent>

. 5 .2 2 using Spring Boot Maven widget

Spring Boot contain a Maven plugin , items can be packaged as an executable jar.

As shown in the following example:

<build>

<plugins>

<plugin>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-maven-plugin</artifactId>

</plugin>

</plugins>

</build>

5 . 3 starter

Initiator is a convenient set of dependency descriptor, you can include the application descriptor. You can get all the necessary Spring and related technical one-stop service, without having to look at sample code and copy and paste depend on the load descriptor.

For example, if you want to test your application, include the project in the spring-boot-starter-test dependencies.

 

If in doubt, watch the video: https://ke.qq.com/course/428845

 

Guess you like

Origin www.cnblogs.com/daqiang123/p/11265709.html