We are using a custom wrapper and custom distribution in order to enforce usage of certain plugins and also bundle our custom plugins.
Its based from:
With some modifications this download a “standard” gradle distro from a local artifactory (to avoid firewall). Unpacks this, fiddles with some files in init.d and re-zips the entire thing and publish it back to local artifactory with another name.
The problem when we run the wrapper it seems to root something to the “wrong” place.
Here is the error:
FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'MyProject'. > java.io.FileNotFoundException: /Users/kkarlberg/.gradle/wrapper/dists/gradle-7.2/f0oc13grnjlmksat8jnm0vvmz/gradle-7.2/lib/plugins/gradle-diagnostics-7.2.jar (No such file or directory)
The problem is that this file exists in directory: /Users/kkarlberg/.gradle/wrapper/dists/gradle-drwp-7.2.0/…
Running the actual gradle command with bash -x does not provide any hints to why gradle establishes this classpath.
bash -x /Users/kkarlberg/.gradle/wrapper/dists/gradle-drwp-7.2.0/cz93240w8z77xnl2zelcme8cq/gradle-7.2/bin/gradle
gives a hint to classpath:
... exec /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -Xmx64m -Xms64m -Dorg.gradle.appname=gradle -classpath /Users/kkarlberg/.gradle/wrapper/dists/gradle-drwp-7.2.0/cz93240w8z77xnl2zelcme8cq/gradle-7.2/lib/gradle-launcher-7.2.jar org.gradle.launcher.GradleMain
To me it looks like that something in GradleMain makes assumptions of the wrapper location