I use Spring Boot and Spring Boot Dependency Management Plugin which helps me use dependencies from Spring Boot BOM. However, Gradle support for BOM import since version 5.0. I made a decision to migrate to Gradle built-in BOM import support. But I run into the issue: I use custom Gradle plugin with dynamically added dependency:
open class MyCustomPlugin : Plugin<Project> {
override fun apply(project: Project): Unit = project.run {
project.dependencies.add("jooqRuntime", "org.postgresql:postgresql")
}
}
This plugis depends on another plugin
dependencies {
implementation("nu.studer:gradle-jooq-plugin:4.1")}
Thus I could get the version of PostgreSQL from this plugin. Now I cannot do the same. How can I resolve dependency added in plugin dynamically?