Download Gradle and repack it.
It's unable to resolve the distribution URL.
java.lang.IllegalStateException: HEAD request for 'https://github.com/gradle/gradle-distributions/releases/download/v8.6.0/gradle-8.6-all.zip' returned unexpected HTTP response status: [Found(302)]. Expected HTTP response status is [Ok(200)]. Cannot continue.
at org.klokwrk.tool.gradle.source.repack.downloader.GradleDownloader.fetchRedirectedHeadResponse(GradleDownloader.groovy:133)
at org.klokwrk.tool.gradle.source.repack.downloader.GradleDownloader.calculateRealDownloadUrlAndContentLength(GradleDownloader.groovy:100)
at org.klokwrk.tool.gradle.source.repack.downloader.GradleDownloader.download(GradleDownloader.groovy:65)
at org.klokwrk.tool.gradle.source.repack.GradleSourceRepackCommand.fetchGradleDistributionZipFile(GradleSourceRepackCommand.groovy:183)
at org.klokwrk.tool.gradle.source.repack.GradleSourceRepackCommand.run(GradleSourceRepackCommand.groovy:118)
at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at io.micronaut.configuration.picocli.PicocliRunner.run(PicocliRunner.java:137)
at io.micronaut.configuration.picocli.PicocliRunner.run(PicocliRunner.java:114)
at org.klokwrk.tool.gradle.source.repack.GradleSourceRepackCommand.main(GradleSourceRepackCommand.groovy:64)
Local java version.
openjdk version "21.0.2" 2024-01-16 LTS
OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)