As far as i can see, the gradle-wrapper.jar is created by the gradle instance used to create the wrapper scripts. So different gradle versions have their unique gradle-wrapper.jar. At most of the time, the gradle-wrapper.jar generated by lower versions of gradle can be used to download gradle with higher versions. My question is, what’s the point of different gradle-wrapper.jars? Is there a case that different versions of gradle-wrapper.jars are not compatible?
Well, like with any software it gets bug fixes or new features.
You are right that up to now I think all wrappers can run all versions.
But for example one change is, that in older versions the CLI process war started with approx. 1/3 of your available RAM as max heap, while in recent versions this is restricted to 64m iirc which usually is more than enough for that part.
If you use the wrapper
task to update the Gradle version, I’d just always run it twice, so that the wrapper files come from the new version, not the old one as you mentioned.
I even have a check-task in my builds that ensures that the wrapper Jar checksum matches the wrapper Jar of the used Gradle version, just to be sure to not forget updating it.
If you want to know what exactly changed in the wrapper over versions, I recommend you have a look at the Git history of subprojects/wrapper
and probably subprojects/wrapper-shared
.