Apache Solr open-source search software
SOLR-17026: Upgrade to Gradle 8.4
Kevin Risdenf6e0e8fb4ab0
diff --git a/build.gradle b/build.gradleindex f10d8a1c23e..aa2389cec04 100644--- a/build.gradle+++ b/build.gradle@@ -20,7 +20,7 @@ import java.time.format.DateTimeFormatterplugins {id "base"- id "com.palantir.consistent-versions" version "2.11.0"+ id "com.palantir.consistent-versions" version "2.16.0"id "org.owasp.dependencycheck" version "8.0.1"id 'ca.cutterslade.analyze' version "1.9.0"id 'de.thetaphi.forbiddenapis' version '3.6' apply falsediff --git a/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java b/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.javaindex a544b6fe735..e6930af7c74 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 > 19) {- throw new IllegalStateException("java version must be between 11 and 19, your version: " + major);+ if (major < 11 || major > 21) {+ throw new IllegalStateException("java version must be between 11 and 21, your version: " + major);}}diff --git a/gradle/testing/defaults-tests.gradle b/gradle/testing/defaults-tests.gradleindex 6783a04c6d7..d291ca85a40 100644--- a/gradle/testing/defaults-tests.gradle+++ b/gradle/testing/defaults-tests.gradle@@ -89,7 +89,7 @@ allprojects {tasks.withType(Test) {ext {- testOutputsDir = file("${reports.junitXml.destination}/outputs")+ testOutputsDir = file("${reports.junitXml.outputLocation.get()}/outputs")}// LUCENE-9660: Make it possible to always rerun tests, even if they're incrementally up-to-date.diff --git a/gradle/validation/check-environment.gradle b/gradle/validation/check-environment.gradleindex 0fddf093c09..d9ea66b694e 100644--- a/gradle/validation/check-environment.gradle+++ b/gradle/validation/check-environment.gradle@@ -22,7 +22,7 @@ import org.gradle.util.GradleVersionconfigure(rootProject) {ext {- expectedGradleVersion = '7.6'+ expectedGradleVersion = '8.4'}wrapper {diff --git a/gradle/wrapper/gradle-wrapper.jar.sha256 b/gradle/wrapper/gradle-wrapper.jar.sha256index b5168d2a1ff..f78f56fee75 100644--- a/gradle/wrapper/gradle-wrapper.jar.sha256+++ b/gradle/wrapper/gradle-wrapper.jar.sha256@@ -1 +1 @@-c5a643cf80162e665cc228f7b16f343fef868e47d3a4836f62e18b7e17ac018a+0336f591bc0ec9aa0c9988929b93ecc916b3c1d52aed202c7381db144aa0ef15diff --git a/gradle/wrapper/gradle-wrapper.jar.version b/gradle/wrapper/gradle-wrapper.jar.versionindex 93c8ddab9fe..a2f28f43be3 100644--- a/gradle/wrapper/gradle-wrapper.jar.version+++ b/gradle/wrapper/gradle-wrapper.jar.version@@ -1 +1 @@-7.6.0+8.4.0diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.propertiesindex f398c33c4b0..744c64d1277 100644--- a/gradle/wrapper/gradle-wrapper.properties+++ b/gradle/wrapper/gradle-wrapper.properties@@ -1,6 +1,6 @@distributionBase=GRADLE_USER_HOMEdistributionPath=wrapper/dists-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip+distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zipnetworkTimeout=10000zipStoreBase=GRADLE_USER_HOMEzipStorePath=wrapper/distsdiff --git a/gradlew b/gradlewindex 03f6fc89ee0..308a3239001 100755--- a/gradlew+++ b/gradlew@@ -1,4 +1,4 @@-#!/bin/sh+#!/usr/bin/env sh## Copyright © 2015-2021 the original authors.@@ -83,10 +83,8 @@ done# This is normally unused# shellcheck disable=SC2034APP_BASE_NAME=${0##*/}-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit--# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'+# 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# Use the maximum available, or set MAX_FD != -1 to use that value.MAX_FD=maximum@@ -133,12 +131,18 @@ location of your Java installation."fielseJAVACMD=java- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.+ if ! command -v java >/dev/null 2>&1+ then+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.Please set the JAVA_HOME variable in your environment to match thelocation of your Java installation."+ fifi+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'+# LUCENE-9471: workaround for gradle leaving junk temp. files behind.GRADLE_TEMPDIR="$APP_HOME/.gradle/tmp"mkdir -p "$GRADLE_TEMPDIR"@@ -151,11 +155,12 @@ DEFAULT_JVM_OPTS="$DEFAULT_JVM_OPTS \"-Djava.io.tmpdir=$GRADLE_TEMPDIR\""if [ "$cygwin" = "true" -o "$msys" = "true" ] ; thenAPP_HOME=`cygpath --path --mixed "$APP_HOME"`fi+GRADLE_WRAPPER_JAR="$APP_HOME/gradle/wrapper/gradle-wrapper.jar""$JAVACMD" $JAVA_OPTS --source 11 "$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 11 - 19."+ echo "ERROR: Something went wrong. Make sure you're using Java version between 11 and 21."exit $WRAPPER_STATUSelif [ "$WRAPPER_STATUS" -ne 0 ]; thenexit $WRAPPER_STATUS@@ -163,7 +168,7 @@ fiCLASSPATH=$GRADLE_WRAPPER_JAR-# START OF SOLR CUSTOMIZATION+# START OF LUCENE CUSTOMIZATION# Generate gradle.properties if they don't existif [ ! -e "$APP_HOME/gradle.properties" ]; then"$JAVACMD" $JAVA_OPTS --source 11 "$APP_HOME/buildSrc/src/main/java/org/apache/lucene/gradle/GradlePropertiesGenerator.java" "$APP_HOME/gradle/template.gradle.properties" "$APP_HOME/gradle.properties"@@ -172,14 +177,14 @@ if [ ! -e "$APP_HOME/gradle.properties" ]; thenexit $GENERATOR_STATUSfifi-# END OF SOLR CUSTOMIZATION+# END OF LUCENE CUSTOMIZATION# Increase the maximum file descriptors if we can.if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; thencase $MAX_FD in #(max*)# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.- # shellcheck disable=SC3045+ # shellcheck disable=SC2039,SC3045MAX_FD=$( ulimit -H -n ) ||warn "Could not query maximum file descriptor limit"esac@@ -187,7 +192,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then'' | soft) :;; #(*)# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.- # shellcheck disable=SC3045+ # shellcheck disable=SC2039,SC3045ulimit -n "$MAX_FD" ||warn "Could not set maximum file descriptor limit to $MAX_FD"esac@@ -232,11 +237,14 @@ if "$cygwin" || "$msys" ; thendonefi-# Collect all arguments for the java command;-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of-# shell script including quotes and variable substitutions, so put them in-# double quotes to make sure that they get re-expanded; and-# * put everything else in single quotes, so that it's not re-expanded.+# Prevent jgit from forking/searching git.exe+export GIT_CONFIG_NOSYSTEM=1++# Collect all arguments for the java command:+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,+# and any embedded shellness will be escaped.+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be+# treated as '${Hostname}' itself on the command line.set -- \"-Dorg.gradle.appname=$APP_BASE_NAME" \diff --git a/gradlew.bat b/gradlew.batindex dc413985442..cb69a0ab1a7 100644--- a/gradlew.bat+++ b/gradlew.bat@@ -71,25 +71,30 @@ echo location of your Java installation.goto fail:execute+@rem Setup the command line@rem LUCENE-9266: verify and download the gradle wrapper jar if we don't have one.set GRADLE_WRAPPER_JAR=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar-"%JAVA_EXE%" --source 11 "%APP_HOME%/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java" "%GRADLE_WRAPPER_JAR%"+"%JAVA_EXE%" %JAVA_OPTS% --source 11 "%APP_HOME%/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java" "%GRADLE_WRAPPER_JAR%"+IF %ERRORLEVEL% EQU 1 goto failWithJvmMessageIF %ERRORLEVEL% NEQ 0 goto fail@rem Setup the command line-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar+set CLASSPATH=%GRADLE_WRAPPER_JAR%-@rem START OF SOLR CUSTOMIZATION+@rem START OF LUCENE CUSTOMIZATION@rem Generate gradle.properties if they don't existIF NOT EXIST "%APP_HOME%\gradle.properties" (@rem local expansion is needed to check ERRORLEVEL inside control blocks.setlocal enableDelayedExpansion- "%JAVA_EXE%" --source 11 "%APP_HOME%/buildSrc/src/main/java/org/apache/lucene/gradle/GradlePropertiesGenerator.java" "%APP_HOME%\gradle\template.gradle.properties" "%APP_HOME%\gradle.properties"+ "%JAVA_EXE%" %JAVA_OPTS% --source 11 "%APP_HOME%/buildSrc/src/main/java/org/apache/lucene/gradle/GradlePropertiesGenerator.java" "%APP_HOME%\gradle\template.gradle.properties" "%APP_HOME%\gradle.properties"IF %ERRORLEVEL% NEQ 0 goto failendlocal)-@rem END OF SOLR CUSTOMIZATION+@rem END OF LUCENE CUSTOMIZATION++@rem Prevent jgit from forking/searching git.exe+SET GIT_CONFIG_NOSYSTEM=1@rem Execute Gradle"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*@@ -97,11 +102,13 @@ IF NOT EXIST "%APP_HOME%\gradle.properties" (:end@rem End local scope for the variables with windows NT shellif %ERRORLEVEL% equ 0 goto mainEnd+goto fail-:fail+:failWithJvmMessage@rem https://github.com/apache/lucene/pull/819-echo Error: Something went wrong. Make sure you're using Java 11 - 19.+echo Error: Something went wrong. Make sure you're using Java version between 11 and 21.+:failrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead ofrem the _cmd.exe /c_ return code!set EXIT_CODE=%ERRORLEVEL%diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 7a1f980fc72..c8dad544cc7 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -89,6 +89,8 @@ Dependency Upgrades---------------------* SOLR-17012: Update Apache Hadoop to 3.3.6 and Apache Curator to 5.5.0 (Kevin Risden)+* SOLR-17026: Upgrade to Gradle 8.4 (Kevin Risden)+Other Changes---------------------(No changes)