Slackbot
04/14/2022, 3:25 PMThomas Broyer
04/15/2022, 7:37 AMgradle.beforeProject { buildscript.configurations.classpath { resolutionStrategy { … } } or something like that.Tapchicoma
04/15/2022, 8:23 AMCannot change resolution strategy of dependency configuration 'classpath' after it has been resolvedThomas Broyer
04/15/2022, 8:46 AMbeforeProject, I'm almost certain I've changed buildscript.repositories that way and correctly seen the new URLs being used to download the dependencies in debug logs. Could it be that the buildscript wasn't targeting the ones from the project?Thomas Broyer
04/15/2022, 8:52 AMgradle.beforeProject { buildscript.dependencies.add("classpath", "foo:bar:baz") }
failing with
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'redacted'.
> Could not resolve all files for configuration ':classpath'.
> Could not find foo:bar:baz.
Searched in the following locations:
- <https://repo.maven.apache.org/maven2/foo/bar/baz/bar-baz.pom>
- <https://plugins.gradle.org/m2/foo/bar/baz/bar-baz.pom>
Required by:
project :Tapchicoma
04/15/2022, 9:23 AMgradle.beforeProject {
buildscript.configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "com.google.code.gson" && requested.name == "gson") {
useVersion(versionProperties["versions.gson"] as String)
because("Force using same gson version because of <https://github.com/google/gson/pull/1991>")
}
}
}
}