Konubinix' opinionated web of thoughts

Bill of Materials

Fleeting

Spring with Maven BOM | Baeldung

[2021-02-27 Sat 15:30]

Project Object Model (POM), can make use of a BOM or “Bill Of Materials”.

[2021-02-27 Sat 15:31]

Maven POM is an XML file that contains information and configurations (about the project) that are used by Maven to import dependencies and to build the project.

[2021-02-27 Sat 15:31]

A BOM is a special kind of POM that is used to control the versions of a project’s dependencies and provide a central place to define and update those versions.

[2021-02-27 Sat 17:10]

Simply put, Dependency Management is a mechanism to centralize the dependency information.

[2021-02-27 Sat 17:10]

we can put all dependency information in a shared POM file called BOM

[2021-02-27 Sat 15:31]

the BOM is a normal POM file with a dependencyManagement section where we can include all an artifact’s information and versions

[2021-02-27 Sat 15:32]

We can inherit from the parent

[2021-02-27 Sat 15:32]

We can also import the BOM.

[2021-02-27 Sat 15:32]

can inherit only a single parent

[2021-02-27 Sat 15:32]

import as many BOMs as we need

[2021-02-27 Sat 17:08]

   <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>baeldung</groupId>
                <artifactId>Baeldung-BOM</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>

Notes linking here