From 61b0014ec968b396af502742bacfb0675deb055d Mon Sep 17 00:00:00 2001 From: Ismael Juma Date: Tue, 8 Feb 2022 12:43:45 -0800 Subject: [PATCH] MINOR: Move `ext` block above `allprojects` block in `build.gradle` (#11741) `ext` contains definitions that should be accessible in `allprojects` (even though we don't use any right now). Reviewers: Jason Gustafson --- build.gradle | 90 ++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/build.gradle b/build.gradle index d7ed2560d52..acf0b19e0cd 100644 --- a/build.gradle +++ b/build.gradle @@ -51,50 +51,6 @@ spotless { } } -allprojects { - - repositories { - mavenCentral() - } - - dependencyUpdates { - revision="release" - resolutionStrategy { - componentSelection { rules -> - rules.all { ComponentSelection selection -> - boolean rejected = ['snap', 'alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier -> - selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ - } - if (rejected) { - selection.reject('Release candidate') - } - } - } - } - } - - configurations.all { - // zinc is the Scala incremental compiler, it has a configuration for its own dependencies - // that are unrelated to the project dependencies, we should not change them - if (name != "zinc") { - resolutionStrategy { - force( - // be explicit about the javassist dependency version instead of relying on the transitive version - libs.javassist, - // ensure we have a single version in the classpath despite transitive dependencies - libs.scalaLibrary, - libs.scalaReflect, - libs.jacksonAnnotations, - // be explicit about the Netty dependency version instead of relying on the version set by - // ZooKeeper (potentially older and containing CVEs) - libs.nettyHandler, - libs.nettyTransportNativeEpoll - ) - } - } - } -} - ext { gradleVersion = versions.gradle minJavaVersion = "8" @@ -102,7 +58,7 @@ ext { defaultMaxHeapSize = "2g" defaultJvmArgs = ["-Xss4m", "-XX:+UseParallelGC"] - + // "JEP 403: Strongly Encapsulate JDK Internals" causes some tests to fail when they try // to access internals (often via mocking libraries). We use `--add-opens` as a workaround // for now and we'll fix it properly (where possible) via KAFKA-13275. @@ -151,6 +107,50 @@ ext { commitId = determineCommitId() } +allprojects { + + repositories { + mavenCentral() + } + + dependencyUpdates { + revision="release" + resolutionStrategy { + componentSelection { rules -> + rules.all { ComponentSelection selection -> + boolean rejected = ['snap', 'alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier -> + selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ + } + if (rejected) { + selection.reject('Release candidate') + } + } + } + } + } + + configurations.all { + // zinc is the Scala incremental compiler, it has a configuration for its own dependencies + // that are unrelated to the project dependencies, we should not change them + if (name != "zinc") { + resolutionStrategy { + force( + // be explicit about the javassist dependency version instead of relying on the transitive version + libs.javassist, + // ensure we have a single version in the classpath despite transitive dependencies + libs.scalaLibrary, + libs.scalaReflect, + libs.jacksonAnnotations, + // be explicit about the Netty dependency version instead of relying on the version set by + // ZooKeeper (potentially older and containing CVEs) + libs.nettyHandler, + libs.nettyTransportNativeEpoll + ) + } + } + } +} + def determineCommitId() { def takeFromHash = 16 if (project.hasProperty('commitId2')) {