Konubinix' opinionated web of thoughts

Best Practices for Structuring Maven Projects and Modules


Best practices for structuring maven projects and modules

[2021-02-28 Sun 14:37]

The best practice used when building Content Packs is called Maven Bill of Materials (BOM), where there is a root Maven project (pom.xml) that defines common dependencies, versions, properties, etc. and the other Maven projects depend on the root Maven Project. A BOM dependency model keeps track of version numbers and ensures that all dependencies (both direct and transitive) are at the same version.

[2021-02-28 Sun 14:37]

The parent project pom.xml should list the child modules and should contain the common set of third party dependencies all the plugins use, common Maven properties, Source Control Management System configurations and the common Maven plugins definitions used for building the Maven modules

[2021-02-28 Sun 14:39]

Make sure that your build components are stable (all unit and integration tests pass). Use the dependencyManagement section in the project pom in order to control the dependency versions.