Reputation: 783
I would like to know if there is a best way to group maven projects.
If I have more than 1 pom project, how is the best way to set them?
Solution 1:
groupid:parent:version (pom)
groupid.parent:child:version (jar)
groupid.parent:subproject:version (pom)
groupid.parent.subproject:childOne:version (jar)
groupid.parent.subproject:childTwo:version (jar)
groupid.parent.subproject:childThree:version (jar)
Solution 2:
groupid:parent:version (pom)
groupid:parent-child:version (jar)
groupid:parent-subproject:version (pom)
groupid:parent-subproject-childOne:version (jar)
groupid:parent-subproject-childTwo:version (jar)
groupid:parent-subproject-childThree:version (jar)
Any other options?!?
Upvotes: 1
Views: 176
Reputation: 1995
I'm preferential to the module organization described in Solution 1. Notice with this approach that you could encounter (or anticipate) some naming collisions...which are politely mitigated by most Maven plugins. For example:
Now pretend you have a Maven web application module that depends on both of the afore mentioned service artefacts. When the maven-war-plugin copies the dependencies to the WEB-INF/lib directory, it is smart enough to discover the service jar filename collisions and renames each jar to include their groupId.
I know that was a lot of extra information, but some people are not aware of this bit of Maven war intelligence...
Upvotes: 1