Greetings!
I would love to understand how the plugin resolution works when using the plugins DSL. Consider the following plugin block from a subproject:
plugins {
id("org.springframework.boot")
id("io.spring.dependency-management")
}
Provided that the versions are given somewhere else in the parent project, how does the first plugin know that it must look for org.springframework.boot:spring-boot-gradle-plugin
in the classpath? Is there any function I can call? Same goes for the second with io.spring.gradle:dependency-management-plugin
?
For reference, I found those dependency notations by searching the plugin ids in question at https://plugins.gradle.org, and then looking at their respective legacy buildscript
block.
Consequently, is there an easy way to avoid those verbose useModule()
calls in a settings.gradle.kts
script?
pluginManagement {
repositories {
gradlePluginPortal()
google()
}
resolutionStrategy {
eachPlugin {
with (requested) {
when (id.id) {
"com.android.application" ->
useModule("com.android.tools.build:gradle:$version")
"androidx.navigation.safeargs.kotlin" ->
useModule("androidx.navigation:navigation-safe-args-gradle-plugin:$version")
}
}
}
}
}
Thank you in anticipation for any help you’ll be able to provide me with. It is genuinely appreciated.