// https://github.com/ben-manes/gradle-versions-plugin
apply plugin: 'com.github.ben-manes.versions'
-// Exclude dev versions from the list of dependency upgrades, for
-// example to replace:
-// org.slf4j:log4j-over-slf4j [1.7.25 -> 1.8.0-beta4]
-// by
-// org.slf4j:log4j-over-slf4j [1.7.25 -> 1.7.26]
-dependencyUpdates.resolutionStrategy {
- componentSelection { rules ->
- rules.all { ComponentSelection selection ->
- boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview'].any { qualifier ->
- selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
- }
- if (rejected) {
- selection.reject('Development version')
- }
+dependencyUpdates {
+ rejectVersionIf {
+ // Exclude dev versions from the list of dependency upgrades, for
+ // example to replace:
+ // org.slf4j:log4j-over-slf4j [1.7.25 -> 1.8.0-beta4]
+ // by
+ // org.slf4j:log4j-over-slf4j [1.7.25 -> 1.7.26]
+ boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview'].any { qualifier ->
+ it.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
+
+ // Exclude upgrades on new major versions :
+ // com.hazelcast:hazelcast [3.12.3 -> 4.0.0]
+ rejected |= !it.candidate.version.substring(0, 2).equals(it.currentVersion.substring(0, 2))
+
+ rejected
}
}