聚合(模块开发): 一个项目可能用多个模块组成 聚合只需要一次运行就可以构件完成
1.新建父模块
2.新建子模块
第五步在工程列表会多项目工程 配置一下就完成了
父模块pom.xml
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>chenjixu</groupId>
<artifactId>All</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>demo1</module>
<module>demo2</module>
</modules>
</project>
子模块pom.xml
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>chenjixu</groupId>
<artifactId>All</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>Show</artifactId>
<packaging>war</packaging>
<name>Show Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
</dependencies>
<build>
<finalName>demo1</finalName>
</build>
</project>
继承