大家好,从本篇文章开始为大家搭建一套springboot后台框架。 技术选型有springboot、mybatis-plus、shiro、druid和swagger等 项目所需环境jdk1.8,maven,mysql数据库,开发工具IDEA。
使用idea新建一个springboot项目进行初始化 pom文件如下
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 1<groupId>com.company</groupId>
2 <artifactId>project</artifactId>
3 <version>0.0.1-SNAPSHOT</version>
4 <packaging>jar</packaging>
5
6 <name>project</name>
7 <description>mySpringboot</description>
8
9 <parent>
10 <groupId>org.springframework.boot</groupId>
11 <artifactId>spring-boot-starter-parent</artifactId>
12 <version>2.1.0.RELEASE</version>
13 <relativePath/> <!-- lookup parent from repository -->
14 </parent>
15
16 <properties>
17 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
19 <java.version>1.8</java.version>
20 </properties>
21
22 <dependencies>
23 <dependency>
24 <groupId>org.springframework.boot</groupId>
25 <artifactId>spring-boot-starter</artifactId>
26 </dependency>
27
28 <dependency>
29 <groupId>org.springframework.boot</groupId>
30 <artifactId>spring-boot-starter-test</artifactId>
31 <scope>test</scope>
32 </dependency>
33 </dependencies>
34
35 <build>
36 <plugins>
37 <plugin>
38 <groupId>org.springframework.boot</groupId>
39 <artifactId>spring-boot-maven-plugin</artifactId>
40 </plugin>
41 </plugins>
42 </build>
43复制代码
44
项目启动类ProjectApplication
1
2
3
4
5
6
7
8
9
10
11
12 1import org.springframework.boot.SpringApplication;
2import org.springframework.boot.autoconfigure.SpringBootApplication;
3
4@SpringBootApplication
5public class ProjectApplication {
6
7 public static void main(String[] args) {
8 SpringApplication.run(ProjectApplication.class, args);
9 }
10}
11复制代码
12