I'm not sure if I'm understanding how to use a parent pom project correctly. I have the following parent pom defined:
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../child1</module>
<module>../child2</module>
</modules>
And then the children pom reference the parent (each child has their own set of dependencies which are not shown):
<parent>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../Parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>child1</artifactId>
This setup works fine and resolves correctly in eclipse (m2eclipse). I can deploy these to my local repository and end up with the following structure, which should be correct:
--com
--example
--parent
--0.0.1-SNAPSHOT
--parent-0.0.1-SNAPSHOT.pom
--child1
--0.0.1-SNAPSHOT
--child1-0.0.1-SNAPSHOT.jar
--child1-0.0.1-SNAPSHOT.pom
--child2
--0.0.1-SNAPSHOT
--child2-0.0.1-SNAPSHOT.jar
--child2-0.0.1-SNAPSHOT.pom
My issue is that I now want to reference the parent project in a different project (not parent, child1, or child2) and thus pull in all of the parent's children. I can add a reference to it in my other project:
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>pom</type>
</dependency>
</dependencies>
When doing this the project shows no errors in eclipse but no artifacts are being added to my classpath: not child1, child2, or any of their dependencies.
I keep thinking there must be a way to have a "master" pom project which isn't a jar in itself but has only references to other jars and then be able to reference that "master" somewhere, but I cannot find out how this is accomplished.