父子项目的好处是多人开发时,可以共用父项目的类库,而每个子项目又可以有自己定制的类库,改动时也只影响这一个模块,并不会影响其他的模块。
步骤1:创建父项目
`
修改packaging属性为pom
<?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>parent</groupId>
<artifactId>com.parent</artifactId>
<version>1.0-SNAPSHOT</version>
<modules>
<module>../basic</module>
<module>rukou</module>
</modules>
<packaging>pom</packaging>
</project>
步骤二:创建子项目
创建完成后,项目结构如图