I am new to Maven, and I’m trying to understand why my company’s modules are organized into “module groups”, but also each submodule explicitly declares its parent. I do not quite understand what the POM Reference is trying to say about the difference between inheritance and aggregation .
For example, the parent module:
<groupId>example.group</groupId> <artifactId>util</artifactId> <packaging>pom</packaging> <name>Util Parent</name> <modules> <module>util_client</module> <module>util_core</module> <module>util_server</module> </modules>
And one of his children:
<parent> <artifactId>util</artifactId> <groupId>example.group</groupId> <version>trunk-SNAPSHOT</version> </parent> <groupId>example.group.util</groupId> <artifactId>util_core</artifactId> <packaging>jar</packaging> <name>Util Core</name>
Why announce it in both directions? Is this redundant? To make things even more confusing, some of the usage submodules depend on eachother:
<groupId>example.group.util</groupId> <artifactId>util_client</artifactId> <packaging>jar</packaging> <name>Util Client</name> <dependencies> <dependency> <groupId>example.group.util</groupId> <artifactId>util_core</artifactId> </dependency> </dependencies>
Sorry if this is an unnecessary question, but wow this is confusing! Thank you for your help.
source share