<modules> <module>childDirectoryName</module> </modules>
其次每个子项目加入,默认继承上层目录中的pom。自定义指定继承关系,需要在parent添加relativePath
<parent> <groupId>com.parent</groupId> <artifactId>parent</artifactId> <version>2.0.0</version> <relativePath>..</relativePath> </parent>
另外一种配置方式,通过配置引用建立关系,在依赖中加入一个type为pom的依赖即可。
<dependencies> <dependency> <groupId>com.parent</groupId> <artifactId>parent</artifactId> <version>2.0.0</version> <type>pom</type> </dependency> </dependencies>