Member-only story
How to make and use BOM (Bill of Materials) dependencies
in Android projects
You've probably come across the BOM term if you’ve worked with big libraries like Jetpack Compose or Firebase. But what exactly is a BOM dependency? Why is it important? And how can we create our own BOM for our SDKs and their dependencies? Let’s find out.
As an example, we can take a look into the Jetpack Compose BOM dependency’s package contents. For this purpose, we can open Google’s Maven repository and search for it. Inside you can see only a POM file. Let’s see what’s inside.
What are the benefits of BOM?
A BOM dependency is a special kind of dependency that specifies the versions of a group of related libraries that are known to work well together. By using a BOM dependency, you can avoid specifying the versions of each individual library in your app, and let the BOM handle the compatibility for you. This can simplify your dependency management and reduce the risk of version conflicts or outdated libraries.
In other words, BOM is shifting the hard work to the library developers so they come up with a list of final versions of dependencies that are made for each other and work fine together with no compile time or run time issues.