Bill of Materials (BOM) for dependencies
A software bill of materials (software BOM) is a list of components in a piece of software. Software vendors often create products by assembling open source and commercial software components. The software BOM describes the components in a product. It is analogous to a list of ingredients on food packaging. (Wikipedia)
Overview
Magnolia uses Maven BOMs to centralize and manage dependency versions across your projects. This ensures version consistency and simplifies dependency management.
Magnolia provides two main BOMs:
-
Third-party dependencies BOM: Manages versions of external libraries (Spring, Jackson, etc.)
-
Extensions BOM: Manages versions of libraries used by DX Core extensions
Both BOMs use Maven’s dependency import mechanism, allowing you to inherit pre-configured dependency versions without explicitly declaring them in your project.
Third-party dependencies BOM
The third-party dependencies BOM (magnolia-external-dependencies) centralizes versions for common external libraries used throughout Magnolia projects.
When to use
Use this BOM to:
-
Ensure compatibility with Magnolia’s tested third-party library versions
-
Avoid version conflicts between different libraries
-
Simplify upgrades by changing a single version number
Adding to your project
Include this snippet as the first dependency in the dependencyManagement section of your parent POM:
<dependencyManagement>
<dependencies>
<!-- Third-party BOM -->
<dependency>
<groupId>info.magnolia.boms</groupId>
<artifactId>magnolia-external-dependencies</artifactId>
<version>{magnola-latest-version}</version> (1)
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Module BOM -->
<dependency>
<groupId>info.magnolia.dx</groupId>
<artifactId>magnolia-dx-core-parent</artifactId>
<version>{magnola-latest-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
| 1 | The latest version is 6.4.0-rc3. |
| The order matters. Place the third-party BOM before the Magnolia module BOM to ensure proper version resolution. |
Extensions BOM
The extensions BOM (magnolia-extensions-bom) manages third-party library versions specifically required by DX Core extensions. This BOM was introduced in Magnolia 6.3 to provide better isolation and version management for extension-specific dependencies.
When to use
Use the extensions BOM when:
-
Your project uses DX Core extensions
-
You’re upgrading to Magnolia 6.3 or later from an earlier version
Adding to your project
Add the extensions BOM to your dependencyManagement section after the third-party BOM:
<dependencyManagement>
<dependencies>
<!-- Third-party BOM -->
<dependency>
<groupId>info.magnolia.boms</groupId>
<artifactId>magnolia-external-dependencies</artifactId>
<version>{magnola-latest-version}</version> (1)
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Extensions BOM (DX Core only) -->
<dependency>
<groupId>info.magnolia.boms</groupId>
<artifactId>magnolia-extensions-bom</artifactId>
<version>{magnola-latest-version}</version> (1)
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Module BOM -->
<dependency>
<groupId>info.magnolia.dx</groupId>
<artifactId>magnolia-dx-core-parent</artifactId>
<version>{magnola-latest-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
| 1 | The latest version is 6.4.0-rc3. |
Best practices
BOM ordering
Always import BOMs in this order:
-
Third-party dependencies BOM
-
Extensions BOM (if using DX Core extensions)
-
Magnolia module BOM (CE or DX Core parent)
This ordering ensures proper dependency resolution and prevents version conflicts.
Version alignment
Keep all BOM versions aligned with your Magnolia version:
<properties>
<magnolia.version>{magnola-latest-version}</magnolia.version> (1)
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>info.magnolia.boms</groupId>
<artifactId>magnolia-external-dependencies</artifactId>
<version>${magnola-latest-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>info.magnolia.boms</groupId>
<artifactId>magnolia-extensions-bom</artifactId>
<version>${magnola-latest-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
| 1 | The latest version is 6.4.0-rc3. |