I’m trying to disable the dynamic version caching for Gradle Plugins for all our builds. I thought about using an init-Script in a custom Gradle-Distribution. I tried the beforeSettings-Closure, but unfortunately settings.pluginManagement.resolutionStrategy has no cacheChangingModulesFor-Method.
Using a buildscript inside the init-Script does not seem to work either:
I never tried that, so just guessing here.
But I think your problem is, that this would only wok for settings plugins as you only set it on settings buildscript configurations.
You probably need to do the same for the buildscript configurations of all projects.
Besides that, cacheChangingModulesFor is for things like ...-SNAPSHOT that are defined as “changing content without changing version number”, not for “dynamic version resolution”. There is a sibling method for that one that you probably intended to use unless “dynamid version caching” was just unlucky wording.
Seems like it’s working now. But how about a settings-plugin? We use that to have a toml-file shared between numerous projects. As far as I understood this one is resolved before any project, so allprojects won’t help in this case.