plugins { id 'com.github.spotbugs' version '5.0.6' id 'com.github.ben-manes.versions' version '0.42.0' } def isNonStable = { String version -> def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) } def regex = /^[0-9,.v-]+(-r)?$/ return !stableKeyword && !(version ==~ regex) } // Define all library dependencies in one file for clarity apply from:'dependencies.gradle' subprojects { apply plugin: "java" apply plugin: "eclipse" apply plugin: "com.github.spotbugs" apply plugin: 'com.github.ben-manes.versions' sourceCompatibility = 1.8 targetCompatibility = 1.8 repositories { mavenCentral() } spotbugsMain { reports {html { enabled = true } } } // Reject all non stable versions tasks.named("dependencyUpdates").configure { rejectVersionIf { isNonStable(it.candidate.version) } } // Standard libraries added to all projects dependencies { testImplementation libraries.junit testImplementation libraries.mockito implementation libraries.slf4jlog4j implementation libraries.slf4j } }