From: Simon Brandhof Date: Tue, 17 Mar 2020 20:25:50 +0000 (+0100) Subject: SONAR-13155 do not suggest major upgrades of dependencies X-Git-Tag: 8.3.0.34182~104 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1b854b3c1bb76bde457a3167e0708a8c9ede2cec;p=sonarqube.git SONAR-13155 do not suggest major upgrades of dependencies --- diff --git a/build.gradle b/build.gradle index 18fded9f6f7..51f1961ceeb 100644 --- a/build.gradle +++ b/build.gradle @@ -531,20 +531,21 @@ artifactory { // 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 } }