-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
151 lines (128 loc) · 6.22 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?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 父项目 -->
<!-- 父项目的作用:做依赖管理,也就是说在父项目中指定了版本号,继承父项目的子项目就不需要写版本号 -->
<!-- parent 几乎声明了所有的开发中常用的 ( 依赖的版本号 ) -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<!-- 项目信息 -->
<groupId>com.example</groupId>
<artifactId>9-lingjing-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>9-lingjing-server</name>
<description>9-lingjing-server</description>
<properties>
<java.version>1.8</java.version>
</properties>
<!-- 项目的打包类型 -->
<!-- pom jar war -->
<!-- 默认是打包成jar包,如果不设置这个标签就是打成 jar -->
<packaging>jar</packaging>
<dependencies>
<!-- spring-boot-starter-web web相关的starter -->
<!-- 这里没写版本好,因为父项目中设置了版本号 -->
<!-- start 就是场景启动器,这个场景需要使用的常规依赖都会自动引入 -->
<!-- SpringBoot官网所有场景:https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.build-systems.starters-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- spring-boot-starter-test 测试相关的starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<!-- lombok -->
<!-- 主要用于自动生成DTO,MODEL,bean对象等的 @Getter @Setter @ToString @EqualsAndHashCode @RequiredArgsConstructor -->
<!-- Lombok 的 scope=provided,说明它只在编译阶段生效,不需要打入包中 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<scope>provided</scope>
</dependency>
<!-- spring-boot-devtools 从新构建 -->
<!--实现重新构建,快捷键:command + f9 则可以重新构建,不需要在重新run-->
<!-- 要实现热更新还需要设置两个地方,具体见我的博客 -->
<!-- 博客地址:https://juejin.cn/post/6929145638898794503 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<!-- jdbc依赖 -->
<!-- 该场景启动器的主要作用:具有 ( 事务,jdbc,数据源 ) -->
<!-- 该场景启动器不包含:数据库驱动,因为SpringBoot并不知道我们使用什么数据库,所以需要安装数据库驱动,比如mysql驱动 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!-- mysql数据库驱动, 版本需要和你安装的mysql版本保持一致,即驱动版本和数据库版本要一致 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.21</version>
<scope>runtime</scope>
</dependency>
<!-- mybatis -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.3</version>
</dependency>
<!-- mybatis plus -->
<!-- mybatis plus包含了 ( mybatis-spring-boot-starter ) 和 ( spring-boot-starter-data-jdbc ) -->
<!-- 在 application.yml 文件中通过 mybatis-plus: xxx 对其进行定制配置 -->
<!-- SqlSessionFactory:自动在容器中配置好了,底层是容器中的默认数据源 -->
<!-- SqlSessionTemplate:自动在容器中配置好了 -->
<!-- @Mapper 标注也会被自动扫描-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.2</version>
</dependency>
<!-- Swagger - springfox-boot-starter -->
<!-- 自动生成 ( 接口文档 ) 及 ( 自测工具 ) -->
<!-- Swagger2 3.0 只需要 ( springfox-boot-starter ) 就可以了 -->
<!-- Swagger2 2.x 则需要 ( springfox-swagger2 ) 和 ( springfox-swagger-ui )-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<!-- spring-boot-starter-thymeleaf -->
<!-- 主要用于显示resources/templates中的html,即返回一个html -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- JWT -->
<!-- JWT 是 json web token 的缩写-->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.15.0</version>
</dependency>
</dependencies>
<!-- 编译 -->
<build>
<plugins>
<!-- spring-boot-maven-plugin -->
<!-- maven插件 -->
<!-- 该插件和打包相关,可以在右侧插件栏中使用 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>