What is inherited in Maven projects

When creating a parent Maven project, what does the child project inherit from?

After I understand, groupId is also inherited by the parent project, but where can I see this in the documentation?

This is all that is indicated (after what I found).

dependencies developers and contributors plugin lists reports lists plugin executions with matching ids plugin configuration 

http://maven.apache.org/pom.html

+4
source share
1 answer

Almost everything that was specified by the parent is inherited by the child. Actually, it’s better to ask: β€œWhat is not inherited by a child project in Maven?” as it is likely to be shorter.

Examples of things not included in the maven inheritance docs list (which you indicated in your question) that are also inherited will be scm , distributionManagement tag, and any declared properties (I use this very little to set the default encoding).

A certain way to find out if a child project has inherited something from a parent is to run help: effective-pom mojo on a child project. This will show you the full effective pom at build time for this project, which will include the inherited elements. An example call below.

 mvn help:effective-pom 

Some IDEs also have tools for viewing an "effective pom" project (ie the M2E eclipse plugin).

+7
source

Source: https://habr.com/ru/post/1396690/


All Articles