What does the parent tag in Maven pom represent?

user710818 picture user710818 · Nov 6, 2011 · Viewed 48.9k times · Source

E.g.:

<parent>
    <groupId>mycompany.trade.com</groupId>
    <artifactId>mycompany.trade.</artifactId>
    <version>1.1.1.0-SNAPSHOT</version>
</parent>

Does it mean that Maven will search for parent pom? If yes, where, in which order? May be in folder up 1 level? Or in local repository or in repo?

Answer

stacker picture stacker · Nov 6, 2011

Yes, maven reads the parent POM from your local repository (or proxies like nexus) and creates an 'effective POM' by merging the information from parent and module POM.

See also Introduction to the POM

One reason to use a parent is that you have a central place to store information about versions of artifacts, compiler-settings etc. that should be used in all modules.