父POM
<modules>
<module>all-common</module>
</modules>
<packaging>pom</packaging>
不添加packaging会出现一下error
Project build error: Invalid packaging for parent POM com.test:hello-parent:0.0.1-SNAPSHOT (E:\eclipse-workspace\hello-parent\pom.xml), must be "pom" but is "jar"
子POM
parent改成父POM属性
<parent>
<groupId>com.clan</groupId>
<artifactId>all</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent>
完成后子POM可以使用父POM依赖。
原文:https://www.cnblogs.com/acong520/p/15149395.html