Gradle supports BOM project to define all dependencies.

Java Platform plugin

1
2
3
4
5
6
7
8
9
10
11
12
13
plugins {
    id 'java-platform'
}

dependencies {
    constraints {
        api 'org.slf4j:slf4j-api:1.7.30'
        api 'org.slf4j:slf4j-simple:1.7.30'
        api 'junit:junit:4.12'

        runtime 'org.postgresql:postgresql:42.2.5'
    }
}

Gradle BOM in Youtube

Gradle BOM in Medium article