Skip to content

Project Inheritance

Introduction

Project inheritance is about sharing POM configuration between projects. See 9.5.3. Project Inheritance for a description of the concept.

There will always be a trade-off between the DRY principle and level of complexity. In other words; while Maven supports the perfect inheritance tree, many levels of inheritance may make the setup too complex.

We will now explain one rather sophisticated setup that evolved in a Norwegian company with more than 50 Maven projects.

project_inheritance

POM descriptions

Example on the Generic Parent POM Example - used by almost all projects in an organization (possibly indirectly).

If you only have Java projects the generic parent pom can be combined with the java parent pom to remove one level of inheritance: