ASIF KAMRAN MALICK
09/04/2024, 11:26 AMgradle wrapper --gradle-version 8.10
But this only updates the gradle-wrapper.properties to use the 8.10 distributionUrl and leaves the gradle-wrapper.jar untouched even though I run the command twice.
I see the older jar of 6.8.3.
However, if I try to set my gradle path locally to 8.10 and run the above command, then it updates the gradle-wrapper.jar too to that of gradle 8.10.
What I have observed is that the choice gradle-wrapper.jar file is dependent on the currently set gradle version (not gradle wrapper).
I am not sure where I could be going wrong. I would have expected the wrapper task to generate the gardle-wrapper.jar file specific to the version that I specify with "--gradle-version" parameterChris Lee
09/04/2024, 12:31 PMVampire
09/04/2024, 4:41 PM--gradle-version parameter just controls which version is written to the properties file and thus the Gradle version used to run the build when properly using the wrapper. It is not to be confused with the Gradle wrapper version, that is the four files that are written to disk, including the wrapper jar.
While newer versions of the wrapper might have improvements or bug fixes, usually also older wrappers can start newer Gradle versions and vice versa. And also not every Gradle version has a different wrapper jar, you see the checksums for the wrapper jar that is included with each Gradle version on https://gradle.org/release-checksums/.
Which Gradle wrapper files are written to disk depends on the Gradle version currently executed. This also is exactly the reason why to run the wrapper task twice. The first call just updates the version in the properties file (and overwrites the four wrapper files with the version from the old Gradle version when using the wrapper or from the version you actually run for example when not using the wrapper), the second call - when typically using the Gradle wrapper to call the wrapper task - would then use the newly updated Gradle version and thus write the new wrapper files to disk.ASIF KAMRAN MALICK
09/04/2024, 8:43 PMASIF KAMRAN MALICK
09/04/2024, 8:44 PM