The required structure is like this
Projects/pom.xml
Projects/parent1/pom.xml
Projects/parent2/pom.xml
Projects/parent2/child1/pom.xml
Projects/parent2/child2/pom.xml
- parent1 and parent2 are module of Projects/pom.xml
- child1 and child2 are modules of parent2
- The packaging type of parent2/pom.xml is pom.
- I have not used the parent tag in the child poms
If I call the parent poms then child1 and child2 are built correctly. The projects/pom.xml exists just as a collector to build all the parent projects.
When I run mvn clean -pl parent2 child1 and child2 are not even recognized. Is this the default behaviour?