0

The project I am involved in developing appears to have the potential to grow into a multi-module project containing sub multi-module projects.

While it was just at multi-module stage I decided to have a parent pom at the root with child poms in each module as maven instructs will work. But now I'm wondering if within the modules I can have poms as well and end up with a sort of tree of poms. Can I do that? What's the best way to structure the project or the poms?

I'm also using Jenkins and archiva as part of the continuous integration cycle.

Ree
  • 863
  • 2
  • 18
  • 38

1 Answers1

0

Yes.

I do that. Children that are just poms and are jars, and children of those that are poms or jars etc. For example here:

https://github.com/drlivingston/kr

I'd be happy to discuss what I did more and why if it helps. But what's "best" really depends on what you need.

You will run the commands on the top pom it will percolate down the module hierarchy and the "reactor" will figure it all out. It will sort out the build order appropriately even if various branches of the trees depend on each other.

DrLivingston
  • 788
  • 6
  • 15
  • I've checked out the link you sent me but I don't see a child pom kind of acting as a parent pom for child pom beneath it... I only see two levels of pom - parent and children and no 'grandchildren' :p maybe I looked in the wrong place? – Ree Apr 03 '14 at 06:44
  • There is the kr parent pom. There is kr-core which is base code right beneath it, with it's own pom. Then there are jena and sesame implementations. so if you go to kr-sesame there is a pom that brings in dependencies and has modules. For example, kr-sesame-core which has a code and is jar packaged. (so this is a grandparent) Note that modules and parents are independent, so it happens that all modules of a give pom have it as a parent, but it's not required. you can have a module hierarchy that has various parents throughout it. – DrLivingston Apr 03 '14 at 21:34