Hi,
this PR updates the project to Gradle 6.2 and updates the Gradle Plugin accordingly to test against 6.1.1 in addition to the new default.
Cheers, Christoph
Comment From: wilkinsona
Thanks very much.
Comment From: dreis2211
@wilkinsona How do we deal with 2.2.x? Should I open a separate PR for addressing the Gradle Plugin compatibility?
Comment From: wilkinsona
If you have the time to do that, that'd be great. Thanks!
Comment From: vpavic
Minor note regarding the upgrade of Gradle - it's generally advisable to execute the wrapper
task using the target Gradle version as there might be changes to wrapper scripts and/or binary.
In the particular case of Gradle 6.2, the gradlew.bat
was updated.
Comment From: dreis2211
@vpavic It only showed line ending changes, so I felt this wasn't necessary. Do you see other changes?
Comment From: vpavic
$ git diff gradlew.bat
warning: CRLF will be replaced by LF in gradlew.bat.
The file will have its original line endings in your working directory
diff --git a/gradlew.bat b/gradlew.bat
index 9618d8d960..62bd9b9cce 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
Comment From: dreis2211
Interesting....I only got this:
git diff gradlew.bat
warning: CRLF wird in gradlew.bat durch LF ersetzt.
````
So essentially the same warning as you but without any changes. Are you running on Windows or on Mac? I'm myself on a Mac.
**Comment From: wilkinsona**
Good catch, @vpavic. Thank you. I've pushed the updates to gradlew.bat in https://github.com/spring-projects/spring-boot/commit/d8c309a31080f2db548178558522fc11769dd60c.
**Comment From: dreis2211**
@wilkinsona Aren't you on a Mac as well? Really sorry for that, but it feels I had no chance here given that the update didn't make the necessary changes. 😞
Did you execute something else than `./gradlew wrapper --gradle-version=6.2`?
**Comment From: wilkinsona**
Yeah, I'm on a Mac. I ran ` ./gradlew wrapper --no-scan`.
**Comment From: dreis2211**
I always followed the official docs: https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper . Seems like I should not do that again. Sorry guys
**Comment From: dreis2211**
I will report this to Gradle, if you don't mind.
**Comment From: wilkinsona**
FWIW, I think what you did to upgrade from 6.1 to 6.2 is right, @dreis2211. What I did (not specifying the version number) only worked because you'd already done the upgrade. Running `./gradlew wrapper --gradle-version=6.2` on 16111f126e707fb5064bab6150df7a77f54850ee (the commit immediately before the upgrade to 6.2) should update `gradlew.bat`, AFAIK.
**Comment From: dreis2211**
Nope, when I run this on a branch where the update wasn't done yet, the same thing happens. Only line ending changes
**Comment From: wilkinsona**
I just tried it and `gradlew.bat` wasn't updated:
$ git reset --hard 16111f126e707fb5064bab6150df7a77f54850ee HEAD is now at 16111f126e Use query-less datasource validation by default $ ./gradlew --no-scan --version
Gradle 6.1.1
Build time: 2020-01-24 22:30:24 UTC Revision: a8c3750babb99d1894378073499d6716a1a1fa5d
Kotlin: 1.3.61 Groovy: 2.5.8 Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019 JVM: 1.8.0_202 (Oracle Corporation 25.202-b08) OS: Mac OS X 10.13.6 x86_64
$ ./gradlew wrapper --gradle-version=6.2 --no-scan Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
BUILD SUCCESSFUL in 38s 1 actionable task: 1 executed
$ git diff HEAD warning: CRLF will be replaced by LF in gradlew.bat. The file will have its original line endings in your working directory diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1b16c34a71..b7c8c5dbf5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
If I run the `wrapper` task again, it updates `gradlew.bat`:
$ ./gradlew wrapper --gradle-version=6.2 --no-scan
BUILD SUCCESSFUL in 4s 1 actionable task: 1 executed $ git diff HEAD warning: CRLF will be replaced by LF in gradlew.bat. The file will have its original line endings in your working directory diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1b16c34a71..b7c8c5dbf5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 9618d8d960..62bd9b9cce 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME%
+@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" ```
Looks like you've found a bug.
Comment From: dreis2211
At least I'm not crazy. I will report this. And sorry for the inconvenience again.
Comment From: wilkinsona
No apology is necessary. You are still approximately 12323549783489723 in credit.
Comment From: vpavic
IMO there's nothing to report to Gradle. The wrapper
task should preferably be executed using the newer Gradle version. It's technically not required to bump the Gradle version used by the project but IMO it is a good practice to ensure you pick up any updates to wrapper scripts/binary.
When you do ./gradlew wrapper --gradle-version=6.2
the wrapper
task will be executed using Gradle version that's currently associated with the project. Subsequent invocation of ./gradlew wrapper
(no --gradle-version
) will then be executed using 6.2.
FWIW my preferred approach to upgradle Gradle is to execute wrapper
task using SDKMAN managed local installation of Gradle. That way I upgrade Gradle via SDKMAN first, and then simply use gradle wrapper
(notice no wrapper) to upgrade across different projects.