spring boot多mudule

parent的pom.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 3     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 4     <modelVersion>4.0.0</modelVersion>
 5 
 6     <groupId>com.xiaoping</groupId>
 7     <artifactId>house-parent</artifactId>
 8     <version>0.0.1-SNAPSHOT</version>
 9     <packaging>pom</packaging>
10 
11     <name>house</name>
12     <description>Demo project for Spring Boot</description>
13 
14     <dependencyManagement>
15         <dependencies>
16             <dependency>
17                 <groupId>org.springframework.boot</groupId>
18                 <artifactId>spring-boot-dependencies</artifactId>
19                 <version>1.4.7.RELEASE</version>
20                 <type>pom</type>
21                 <scope>import</scope>
22             </dependency>
23 
24         </dependencies>
25     </dependencyManagement>
26 
27     <properties>
28         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
29         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
30         <java.version>1.8</java.version>
31     </properties>
32 
33 
34 <modules>
35     <module>house-common</module>
36     <module>house-biz</module>
37     <module>house-web</module>
38 </modules>
39 
40 
41 
42 
43 </project>
View Code

common的pom.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 3     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 4     <modelVersion>4.0.0</modelVersion>
 5 
 6     <groupId>com.xiaoping</groupId>
 7     <artifactId>house-common</artifactId>
 8     <version>0.0.1-SNAPSHOT</version>
 9 
10 
11     <name>house-common</name>
12     <description>Demo project for Spring Boot</description>
13 
14     <parent>
15         <groupId>com.xiaoping</groupId>
16         <artifactId>house-parent</artifactId>
17         <version>0.0.1-SNAPSHOT</version>
18     </parent>
19     
20     <dependencies>
21         <dependency>
22             <groupId>org.apache.httpcomponents</groupId>
23             <artifactId>httpclient</artifactId>
24         </dependency>
25         <dependency>
26             <groupId>org.projectlombok</groupId>
27             <artifactId>lombok</artifactId>
28             <version>1.16.20</version>
29         </dependency>
30         <dependency>
31             <groupId>com.google.guava</groupId>
32             <artifactId>guava</artifactId>
33             <version>18.0</version>
34         </dependency>
35         <dependency>
36             <groupId>org.springframework.boot</groupId>
37             <artifactId>spring-boot-starter-web</artifactId>
38         </dependency>
39 
40         <dependency>
41         <groupId>org.springframework.boot</groupId>
42         <artifactId>spring-boot-starter-test</artifactId>
43         <scope>test</scope>
44         </dependency>
45     </dependencies>
46 
47 
48 
49 
50 </project>
View Code

 

biz的pom.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 3     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 4     <modelVersion>4.0.0</modelVersion>
 5 
 6     <groupId>com.xiaoping</groupId>
 7     <artifactId>house-biz</artifactId>
 8     <version>0.0.1-SNAPSHOT</version>
 9 
10 
11     <name>house-biz</name>
12     <description>Demo project for Spring Boot</description>
13 
14     <parent>
15         <groupId>com.xiaoping</groupId>
16         <artifactId>house-parent</artifactId>
17         <version>0.0.1-SNAPSHOT</version>
18         <relativePath>../pom.xml</relativePath>
19     </parent>
20 
21 
22 
23     <dependencies>
24 
25         <dependency>
26             <groupId>com.xiaoping</groupId>
27             <artifactId>house-common</artifactId>
28             <version>0.0.1-SNAPSHOT</version>
29         </dependency>
30         <dependency>
31             <groupId>org.mybatis.spring.boot</groupId>
32             <artifactId>mybatis-spring-boot-starter</artifactId>
33             <version>1.3.1</version>
34         </dependency>
35         <dependency>
36             <groupId>mysql</groupId>
37             <artifactId>mysql-connector-java</artifactId>
38         </dependency>
39         <!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
40         <dependency>
41             <groupId>com.alibaba</groupId>
42             <artifactId>druid</artifactId>
43             <version>1.1.8</version>
44         </dependency>
45     </dependencies>
46 
47 
48 
49 </project>
View Code

 

web的pom.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 3     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 4     <modelVersion>4.0.0</modelVersion>
 5 
 6     <groupId>com.xiaoping</groupId>
 7     <artifactId>house-web</artifactId>
 8     <version>0.0.1-SNAPSHOT</version>
 9     <packaging>jar</packaging>
10 
11     <name>house-web</name>
12     <description>Demo project for Spring Boot</description>
13 
14     <parent>
15         <groupId>com.xiaoping</groupId>
16         <artifactId>house-parent</artifactId>
17         <version>0.0.1-SNAPSHOT</version>
18     </parent>
19 
20 
21 
22     <dependencies>
23         <dependency>
24         <groupId>com.xiaoping</groupId>
25         <artifactId>house-biz</artifactId>
26         <version>0.0.1-SNAPSHOT</version>
27     </dependency>
28         <dependency>
29             <groupId>org.springframework.boot</groupId>
30             <artifactId>spring-boot-starter-test</artifactId>
31             <scope>test</scope>
32         </dependency>
33         <dependency>
34             <groupId>org.springframework.boot</groupId>
35             <artifactId>spring-boot-starter-freemarker</artifactId>
36         </dependency>
37         <dependency>
38             <groupId>org.springframework.boot</groupId>
39             <artifactId>spring-boot-starter-web</artifactId>
40         </dependency>
41     </dependencies>
42 
43     <build>
44         <plugins>
45             <plugin>
46                 <groupId>org.springframework.boot</groupId>
47                 <artifactId>spring-boot-maven-plugin</artifactId>
48             </plugin>
49             <plugin>
50                 <groupId>org.apache.maven.plugins</groupId>
51                 <artifactId>maven-compiler-plugin</artifactId>
52                 <version>3.1</version>
53                 <configuration>
54                     <source>1.8</source>
55                     <target>1.8</target>
56                 </configuration>
57             </plugin>
58         </plugins>
59     </build>
60 
61 </project>
View Code

parent管理所有Modules,所有的都继承parent,biz依赖common,web引入依赖biz

posted @ 2018-03-01 14:19  88aa123  阅读(195)  评论(0编辑  收藏  举报