Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven3 multi module child groupId

In maven3, I get warnings if I specify the groupId of a child module in a multi-module project to be the same as the parent module. Now I'm not sure if this is indicating that I should use a different groupId or if I should omit it to use the parent groupId.

According to http://maven.apache.org/guides/mini/guide-naming-conventions.html

A good way to determine the granularity of the groupId is to use the project structure. That is, if the current project is a multiple module project, it should append a new identifier to the parent's groupId. eg. org.apache.maven, org.apache.maven.plugins, org.apache.maven.reporting

That leads me to believe that each child should have a different groupId than the parent. Is that correct?

like image 524
Jeff Storey Avatar asked Jan 29 '26 12:01

Jeff Storey


1 Answers

From the maven documentation

If we want the groupId and / or the version of your modules to be the same as their parents, you can remove the groupId and / or the version identity of your module in its POM. This allows the module to inherit the groupId and / or the version of its parent POM.

The warning is to let the user know this and avoid situations like misspelling groupId or versionId.

like image 121
Raghuram Avatar answered Jan 31 '26 07:01

Raghuram



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!