多模块项目搭建
springboot基于maven多模块项目搭建(直接启动webApplication)
1. 新建maven项目springboot-module

2.把src删掉,新建module项目
-
springboot-module-api
-
springboot-module-model
-
springboot-module-service
-
springboot-module-util
-
springboot-module-web

3. 添加模块之间的依赖
3.1 springboot-module.pom
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5 <modelVersion>4.0.0</modelVersion>
6
7 <groupId>com.springboot.module</groupId>
8 <artifactId>springboot-module</artifactId>
9 <packaging>pom</packaging>
10 <version>1.0-SNAPSHOT</version>
11 <modules>
12 <module>springboot-module-api</module>
13 <module>springboot-module-model</module>
14 <module>springboot-module-service</module>
15 <module>springboot-module-util</module>
16 <module>springboot-module-web</module>
17 </modules>
18
19 <!-- Spring boot 父引用-->
20 <parent>
21 <groupId>org.springframework.boot</groupId>
22 <artifactId>spring-boot-starter-parent</artifactId>
23 <version>1.4.1.RELEASE</version>
24 </parent>
25 <dependencies>
26 <!-- Spring boot 核心web-->
27 <dependency>
28 <groupId>org.springframework.boot</groupId>
29 <artifactId>spring-boot-starter-web</artifactId>
30 </dependency>
31 <dependency>
32 <groupId>org.projectlombok</groupId>
33 <artifactId>lombok</artifactId>
34 <version>1.16.18</version>
35 </dependency>
36 <dependency>
37 <groupId>org.springframework.boot</groupId>
38 <artifactId>spring-boot-starter-logging</artifactId>
39 </dependency>
40 <dependency>
41 <groupId>org.springframework.boot</groupId>
42 <artifactId>spring-boot-starter-test</artifactId>
43 </dependency>
44 </dependencies>
45
46 <build>
47 <
