This is an automated email from the ASF dual-hosted git repository.
houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new a40a0419104 SOLR-17545: Upgrade to Gradle 8.10 (#2848)
a40a0419104 is described below
commit a40a0419104a5b7b1d4afd7d7b028d677aeb0ffd
Author: Houston Putman <[email protected]>
AuthorDate: Tue Nov 5 14:27:09 2024 -0600
SOLR-17545: Upgrade to Gradle 8.10 (#2848)
(cherry picked from commit aaa2401040bbb7ce884c7eba91a496884eb1252a)
---
.../apache/lucene/gradle/WrapperDownloader.java | 4 ++--
gradle/documentation/render-javadoc.gradle | 2 +-
gradle/globals.gradle | 2 +-
gradle/node.gradle | 2 +-
gradle/solr/packaging.gradle | 2 +-
gradle/testing/alternative-jdk-support.gradle | 2 +-
gradle/testing/beasting.gradle | 2 +-
gradle/testing/profiling.gradle | 2 +-
gradle/testing/randomization.gradle | 8 ++++----
gradle/testing/slowest-tests-at-end.gradle | 2 +-
gradle/validation/check-environment.gradle | 2 +-
gradle/validation/jar-checks.gradle | 22 ++++++++++++++------
gradle/validation/spotless.gradle | 2 +-
gradle/wrapper/gradle-wrapper.jar.sha256 | 2 +-
gradle/wrapper/gradle-wrapper.jar.version | 2 +-
gradle/wrapper/gradle-wrapper.properties | 3 ++-
gradlew | 9 +++++---
gradlew.bat | 24 ++++++++++++----------
settings.gradle | 2 +-
solr/CHANGES.txt | 2 ++
20 files changed, 58 insertions(+), 40 deletions(-)
diff --git
a/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java
b/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java
index e6930af7c74..420485d69b2 100644
--- a/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java
+++ b/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java
@@ -61,8 +61,8 @@ public class WrapperDownloader {
public static void checkVersion() {
int major = Runtime.getRuntime().version().feature();
- if (major < 11 || major > 21) {
- throw new IllegalStateException("java version must be between 11 and 21,
your version: " + major);
+ if (major < 11 || major > 23) {
+ throw new IllegalStateException("java version must be between 11 and 23,
your version: " + major);
}
}
diff --git a/gradle/documentation/render-javadoc.gradle
b/gradle/documentation/render-javadoc.gradle
index 5f5b6058af2..e4784370940 100644
--- a/gradle/documentation/render-javadoc.gradle
+++ b/gradle/documentation/render-javadoc.gradle
@@ -32,7 +32,7 @@ allprojects {
missingdoclet "org.apache.solr.tools:missing-doclet"
}
- ext {
+ project.ext {
relativeDocPath = project.path.replaceFirst(/:\w+:/, "").replace(':',
'/')
}
diff --git a/gradle/globals.gradle b/gradle/globals.gradle
index 48131b3003b..aec37217091 100644
--- a/gradle/globals.gradle
+++ b/gradle/globals.gradle
@@ -37,7 +37,7 @@ allprojects {
// so :solr:core will have solr-core.jar, etc.
project.archivesBaseName = project.path.replaceAll("^:", "").replace(':',
'-')
- ext {
+ project.ext {
// Utility method to support passing overrides via -P or -D.
propertyOrDefault = { propName, defValue ->
def result
diff --git a/gradle/node.gradle b/gradle/node.gradle
index 3da3a51d40e..ff8404c2db2 100644
--- a/gradle/node.gradle
+++ b/gradle/node.gradle
@@ -34,7 +34,7 @@ configure([project(":solr:packaging"),
project(":solr:solr-ref-guide"), project(
}
}
- ext {
+ project.ext {
rootNodeDir = "$rootDir/.gradle/node"
nodeProjectDir = file("$rootNodeDir/$project.name")
}
diff --git a/gradle/solr/packaging.gradle b/gradle/solr/packaging.gradle
index 11ffb560688..1b5325f908b 100644
--- a/gradle/solr/packaging.gradle
+++ b/gradle/solr/packaging.gradle
@@ -38,7 +38,7 @@
configure(allprojects.findAll {project ->
project.path.startsWith(":solr:modules:") || project.path ==
":solr:prometheus-exporter" || project.path == ":solr:cross-dc-manager" }) {
plugins.withType(JavaPlugin) {
- ext {
+ project.ext {
packagingDir = file("${buildDir}/packaging")
if (project.path.startsWith(":solr:prometheus-exporter") ||
project.path.startsWith(":solr:cross-dc-manager")) {
deps = packagingDir
diff --git a/gradle/testing/alternative-jdk-support.gradle
b/gradle/testing/alternative-jdk-support.gradle
index 72cdabdab4b..a1ff1b4b014 100644
--- a/gradle/testing/alternative-jdk-support.gradle
+++ b/gradle/testing/alternative-jdk-support.gradle
@@ -87,6 +87,6 @@ if (jvmGradle != jvmCurrent) {
// Set up root project's properties.
rootProject.ext.runtimeJavaHome = jvmCurrent.javaHome
-rootProject.ext.runtimeJavaVersion = jvmDetector.getMetadata(new
InstallationLocation(jvmCurrent.javaHome, "specific path")).getLanguageVersion()
+rootProject.ext.runtimeJavaVersion =
jvmDetector.getMetadata(InstallationLocation.userDefined(jvmCurrent.javaHome,
"specific path")).getLanguageVersion()
rootProject.ext.usesAltJvm = (jvmGradle != jvmCurrent);
diff --git a/gradle/testing/beasting.gradle b/gradle/testing/beasting.gradle
index 8934100ec10..67c20140ba8 100644
--- a/gradle/testing/beasting.gradle
+++ b/gradle/testing/beasting.gradle
@@ -27,7 +27,7 @@ def beastingMode = gradle.startParameter.taskNames.any{ name
-> name == 'beast'
allprojects {
plugins.withType(JavaPlugin) {
- ext {
+ project.ext {
testOptions += [
[propName: 'tests.dups', value: 0, description: "Reiterate runs of
entire test suites ('beast' task)."]
]
diff --git a/gradle/testing/profiling.gradle b/gradle/testing/profiling.gradle
index 34b3efe59fa..cefab4d0ea9 100644
--- a/gradle/testing/profiling.gradle
+++ b/gradle/testing/profiling.gradle
@@ -21,7 +21,7 @@ def recordings = files()
allprojects {
plugins.withType(JavaPlugin) {
- ext {
+ project.ext {
testOptions += [
[propName: 'tests.profile', value: false, description: "Enable java
flight recorder profiling."]
]
diff --git a/gradle/testing/randomization.gradle
b/gradle/testing/randomization.gradle
index 1cfe5f0f928..68405f39404 100644
--- a/gradle/testing/randomization.gradle
+++ b/gradle/testing/randomization.gradle
@@ -79,7 +79,7 @@ allprojects {
// Configure test property defaults and their descriptions.
allprojects {
plugins.withType(JavaPlugin) {
- ext {
+ project.ext {
testOptions += [
// seed, repetition and amplification.
[propName: 'tests.seed', value: { -> rootSeed }, description: "Sets
the master randomization seed."],
@@ -124,7 +124,7 @@ allprojects {
// Add Solr-specific test configs settings.
configure(allprojects.findAll {project -> project.path.startsWith(":solr") }) {
plugins.withType(JavaPlugin) {
- ext {
+ project.ext {
testOptions += [
[propName: 'solr.directoryFactory', value:
"org.apache.solr.core.MockDirectoryFactory", description: "Solr directory
factory."],
[propName: 'tests.src.home', value: null, description: "See
SOLR-14023."],
@@ -138,14 +138,14 @@ configure(allprojects.findAll {project ->
project.path.startsWith(":solr") }) {
allprojects {
plugins.withType(JavaPlugin) {
afterEvaluate {
- ext.testOptionsResolved = testOptions.findAll { opt ->
+ project.ext.testOptionsResolved = testOptions.findAll { opt ->
propertyOrDefault(opt.propName, opt.value) != null
}.collectEntries { opt ->
[(opt.propName): Objects.toString(resolvedTestOption(opt.propName))]
}
// Compute the "reproduce with" string.
- ext.testOptionsForReproduceLine = testOptions.findAll { opt ->
+ project.ext.testOptionsForReproduceLine = testOptions.findAll { opt ->
if (opt["includeInReproLine"] == false) {
return false
}
diff --git a/gradle/testing/slowest-tests-at-end.gradle
b/gradle/testing/slowest-tests-at-end.gradle
index eaf9cd1a2f1..d24e523394d 100644
--- a/gradle/testing/slowest-tests-at-end.gradle
+++ b/gradle/testing/slowest-tests-at-end.gradle
@@ -22,7 +22,7 @@ def allSuites = []
allprojects {
plugins.withType(JavaPlugin) {
- ext {
+ project.ext {
testOptions += [
[propName: 'tests.slowestTests', value: true, description: "Print
the summary of the slowest tests."],
[propName: 'tests.slowestSuites', value: true, description: "Print
the summary of the slowest suites."]
diff --git a/gradle/validation/check-environment.gradle
b/gradle/validation/check-environment.gradle
index d9ea66b694e..f07d3ab8016 100644
--- a/gradle/validation/check-environment.gradle
+++ b/gradle/validation/check-environment.gradle
@@ -22,7 +22,7 @@ import org.gradle.util.GradleVersion
configure(rootProject) {
ext {
- expectedGradleVersion = '8.4'
+ expectedGradleVersion = '8.10'
}
wrapper {
diff --git a/gradle/validation/jar-checks.gradle
b/gradle/validation/jar-checks.gradle
index d416a9561fd..9254b4fe9c0 100644
--- a/gradle/validation/jar-checks.gradle
+++ b/gradle/validation/jar-checks.gradle
@@ -1,3 +1,5 @@
+import java.util.stream.Collectors
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -76,14 +78,14 @@ subprojects {
// Configure jarValidation configuration for all projects. Any dependency
// declared on this configuration (or any configuration it extends from) will
// be verified.
- configurations {
+ project.configurations {
jarValidation
}
// For Java projects, add all dependencies from the following configurations
// to jar validation
plugins.withType(JavaPlugin) {
- configurations {
+ project.configurations {
jarValidation {
extendsFrom runtimeClasspath
extendsFrom compileClasspath
@@ -109,16 +111,24 @@ subprojects {
}
def excludeRules = configurations.jarValidation.excludeRules
+ List<Map<String, String>> excludeRuleMaps;
+ if (excludeRules && excludeRules.size() > 0) {
+ excludeRuleMaps = excludeRules.stream().map {rule ->
+ if (rule.module != null) {
+ Map.of("group", rule.group, "module", rule.module)
+ } else {
+ Map.of("group", rule.group)
+ }
+ }.collect(Collectors.toList())
+ }
ArrayDeque<ResolvedDependency> queue = new ArrayDeque<>()
configurations.jarValidation.extendsFrom.each { conf ->
- if (excludeRules) {
+ if (excludeRules && excludeRules.size() > 0) {
conf = conf.copyRecursive()
conf.canBeResolved = true
conf.canBeConsumed = true
- def newConfExcludeRules = new HashSet<>(conf.excludeRules)
- newConfExcludeRules.addAll(excludeRules)
- conf.excludeRules = newConfExcludeRules
+ excludeRuleMaps.forEach {conf.exclude(it)}
}
if (conf.canBeResolved) {
queue.addAll(conf.resolvedConfiguration.firstLevelModuleDependencies)
diff --git a/gradle/validation/spotless.gradle
b/gradle/validation/spotless.gradle
index 95607c67327..c237838af68 100644
--- a/gradle/validation/spotless.gradle
+++ b/gradle/validation/spotless.gradle
@@ -26,7 +26,7 @@ configure(project(":solr").subprojects) { prj ->
plugins.withType(JavaPlugin) {
prj.apply plugin: 'com.diffplug.spotless'
- ext {
+ project.ext {
spotlessJavaSetup = (Action){
it.toggleOffOn() // obviously, only to be used sparingly.
// TODO: Work out how to support multiple different header files (we
have
diff --git a/gradle/wrapper/gradle-wrapper.jar.sha256
b/gradle/wrapper/gradle-wrapper.jar.sha256
index f78f56fee75..67dead8f441 100644
--- a/gradle/wrapper/gradle-wrapper.jar.sha256
+++ b/gradle/wrapper/gradle-wrapper.jar.sha256
@@ -1 +1 @@
-0336f591bc0ec9aa0c9988929b93ecc916b3c1d52aed202c7381db144aa0ef15
+2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046
diff --git a/gradle/wrapper/gradle-wrapper.jar.version
b/gradle/wrapper/gradle-wrapper.jar.version
index a2f28f43be3..dd78a707858 100644
--- a/gradle/wrapper/gradle-wrapper.jar.version
+++ b/gradle/wrapper/gradle-wrapper.jar.version
@@ -1 +1 @@
-8.4.0
+8.10.2
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties
b/gradle/wrapper/gradle-wrapper.properties
index 744c64d1277..9355b415575 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index c0f76e91038..91b88c91774 100755
--- a/gradlew
+++ b/gradlew
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-#
https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#
https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set
(https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
+' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -161,7 +164,7 @@ if [ ! -e "$GRADLE_WRAPPER_JAR" ]; then
"$JAVACMD" $JAVA_OPTS
"$APP_HOME/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java"
"$GRADLE_WRAPPER_JAR"
WRAPPER_STATUS=$?
if [ "$WRAPPER_STATUS" -eq 1 ]; then
- echo "ERROR: Something went wrong. Make sure you're using Java version
between 11 and 21."
+ echo "ERROR: Something went wrong. Make sure you're using Java version
between 11 and 23."
exit $WRAPPER_STATUS
elif [ "$WRAPPER_STATUS" -ne 0 ]; then
exit $WRAPPER_STATUS
diff --git a/gradlew.bat b/gradlew.bat
index 172618e3ea4..7223dcfff74 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@@ -48,11 +50,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your
PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your
PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -62,11 +64,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -108,7 +110,7 @@ goto fail
:failWithJvmMessage
@rem https://github.com/apache/lucene/pull/819
-echo Error: Something went wrong. Make sure you're using Java version between
11 and 21.
+echo Error: Something went wrong. Make sure you're using Java version between
11 and 23.
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code
instead of
diff --git a/settings.gradle b/settings.gradle
index c32a49b9778..8cc382ddc8d 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -23,7 +23,7 @@ pluginManagement {
}
plugins {
- id 'com.gradle.develocity' version '3.17.6'
+ id 'com.gradle.develocity' version '3.18.1'
id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.0.2'
}
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 34086dc9908..c1a7cd0f8d2 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -116,6 +116,8 @@ led to the suppression of exceptions. (Andrey Bozhko)
* SOLR-17534: Introduce ClusterState.getCollectionNames, a convenience method
(David Smiley)
+* SOLR-17545: Upgrade to Gradle 8.10 (Houston Putman)
+
================== 9.7.1 ==================
Bug Fixes
---------------------