Migrate Maven BOM to Gradle

I’m currently working on migrating a project from Maven to Gradle. It’s a project that contains multiple modules and is quite large.
I’m hesitating about how to migrate the Maven BOM to Gradle. I learn from the gradle’s official tutorial that i should use platform. At the same time, I find spring-boot (which is also a large project and has migrated from Maven to Gradle, i learn from their experience) use their own plugin. Also, i find that there’s a plugin called io.spring.dependency-management which helps gain use experience just like dependencyManagement in Maven.
So now i’m quite confused, what is the best practise to deal with BOM in Gradle?

The spring dependency management plugin is an obsolete relict from times when Gradle did not have built-in BOM support. Even the maintainer of that plugin recommends not to use it anymore, but to use the built-in BOM support with platform(...). So you shouldn’t use that plugin.

To consume a BOM, just use something like implementation(platform("coordinates of the bom")), or actually a version catalog instead of the coordinates directly.

2 Likes