一、准备工作
进入springboot的环境搭建页面https://start.spring.io/
输入需要集成的项目,例如集成springboot的web、redis、mysql、mybatis,如下图所示:
点击Generate Project 按钮,生成springboot的基础代码
springboot 的pom.xml内容如下
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4 4.0.0
5
6 org.springframework.boot
7 spring-boot-starter-parent
8 2.1.1.RELEASE
9
10
11 com.example
12 demo
13 0.0.1-SNAPSHOT
14 demo
15 Demo project for Spring Boot
16
17
18 1.8
19
20
21
22
23 org.springframework.boot
24 spring-boot-starter-data-redis
25
26
27 com.alibaba
28 fastjson
29 1.2.44
30
31
32 org.springframework.boot
33 spring-boot-starter-web
34
35
36 org.mybatis.spring.boot
37 mybatis-spring-boot-starter
38 1.3.2
39
40
41
42 mysql
43 mysql-connector-java
44 runtime
45
46
47 org.springframework.boot
48 spring-boot-starter-test
49 test
50
51
52
53
54
55
56
57
58 src/main/resources
59
60 **/**
61
62 false
63
64
65 src/main/java
66
67 **/*.properties
68 **/*.xml
69
70 false
71
72
73
74
75 org.springframework.boot
76 spring-boot-maven-plugin
77
78
79
80 org.apache.maven.plugins
81 maven-surefire-plugin
82
83 true
84
85
86
87
88 maven-source-plugin
89
90 true
91
92
93
94 compile
95
96 jar
97
98
99
100
101
102
103 org.apache.maven.plugins
104 maven-war-plugin
105
106 src/main/resources/**
107 yakult
108
109
110