Vladimir Berlev
Vladimir Berlev

Reputation: 502

Why Gradle Wrapper JAR checksum doesn't match when generated by gradle binary from Ubuntu package

Gradle Manual (1) suggests to verify Gradle Wrapper Jar against officially published release checksums (2). When generating with gradle wrapper command and gradle being installed via apt-get install gradle resulting wrapper Jar's checksum doesn't match any from (2).

Checked on Ubuntu 19.10, 18.04.3.

Upvotes: 2

Views: 1140

Answers (1)

Bjørn Vester
Bjørn Vester

Reputation: 7598

Many Linux distributions build their own distribution of Gradle, though I have no idea why. I assume this is the case for Ubuntu. And when you use a custom built distribution, it is not unreasonable to see why the checksum might end up different than the official ones.

You should only use a locally installed distribution for the first time you initialize a Gradle project. So I expect this problem will go away once you change the version for the project. For example, assume you are on a custom version 6.0 now, and you run gradlew wrapper --gradle-version 6.0.1 --distribution-type all twice in a row* (notice the 'w'), then it will update your project distribution of Gradle to a newer and official version. I would be surprised if the checksum didn't match after that.

Alternatively, you could also download the wrapper jar manually.

*) It is good practice to run the wrapper script twice as the wrapper scripts themselves are only updated on the second run once the newer version has been downloaded.

Upvotes: 3

Related Questions