今天刚学习springboot,搜罗了一些信息,对于配置文件中的一些依赖的意思做了一些整理,方便自己理解。
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.9</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.situ</groupId>
<artifactId>testboot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>testboot</name>
<description>testboot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--mybatis plus启动器-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.3.1</version>
</dependency>
<!--Thymeleaf 是一个模板引擎,由于SpringBoot默认使用Thymeleaf,现逐步取代jsp。
SpringBoot 为 Thymeleaf 提供了一系列默认配置,项目中一但导入了 Thymeleaf 的依赖,
相对应的自动配置(ThymeleafAutoConfiguration)就会自动生效,Thymeleaf会自动渲染templates下的html-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--boot核心,web启动器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--mybatis-spring-boot-starter:在SpringBoot启动时
去扫描所有Mapper接口,然后为其增加一个代理实现类,
在调用的过程中,我们实际调用的是这个代理对象-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.3.0</version>
</dependency>
<!--springboot提供的工具类,引入后可以
1.实现热部署,类修改时,只对修改过的类重新加载,使得项目重新启动时速度极快
2.对于前端使用模板引擎的项目,能够自动禁用缓存,在页面修改后,只需要刷新浏览器器页面即可。-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<!--mysql连接器-->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!--spring-boot-starter-test是一个聚合的“入门包”,用于经常一起用于在 Spring 应用程序中进行测试的库。
如最新版本引用 documentation 中所述, spring-boot-starter-test包含:
JUnit 5(包括与 JUnit 4 向后兼容的老式引擎)
Spring 测试和 Spring Boot 测试 - 这是 spring-boot-test依赖)
AssertJ、Hamcrest、Mockito、JSONassert 和 JsonPath。 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>