Spring Boot 学习第一课:pom配置文件中引用的依赖的细节解释

Posted honny-seven

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring Boot 学习第一课:pom配置文件中引用的依赖的细节解释相关的知识,希望对你有一定的参考价值。

最近开始学习Spring Boot,关于配置文件有部分理解,请见红色注释部分。


<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.atguigu</groupId>
<artifactId>spring-boot-01-helloworld</artifactId>
<version>1.0-SNAPSHOT</version>

<!--spring-boot-starter-parent:spring-boot项目中的starter项目的父项目。
spring-boot-starter-parent的父项目是spring-boot-dependencies,
在properties中集成管理了Spring Boot应用的所有的依赖版本,类似于Spring Boot的版本仲裁中心。
所以开发人员在导入依赖版本时,不需要写版本,只有在dependencies中没有的依赖才需要声明版本号-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
</parent>

<!--spring-boot-starter:spring-boot场景的启动器;帮开发人员导入web模块正常运行所依赖的组件-->
<!--Spring Boot 将所有的功能场景都抽取出来,做成一个个的starter(启动器),
只需要在项目中引用这些starter 相关场景的所有依赖就会导入进来。-->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

</dependencies>

<!--spring-boot-maven-plugin,这个插件,可以将应用打包成一个可以执行的jar包-->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

以上是关于Spring Boot 学习第一课:pom配置文件中引用的依赖的细节解释的主要内容,如果未能解决你的问题,请参考以下文章

spring-boot学习

pom 怎么去除spring boot logback-classic

Spring Boot多modules的pom文件配置

Spring Boot 推荐的基础 POM 文件

spring boot 学习SpringBoot配置发送Email

Spring-boot的pom.xml配置文件