-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin DSL should not declare the dependency management plugin #903
Comments
There's a trade-off to be made here. The current approach allows boms to be imported like this: plugins {
// …
id("org.springframework.boot") version "2.1.5.RELEASE"
id("io.spring.dependency-management") version "1.0.7.RELEASE"
}
dependencyManagement {
imports {
mavenBom("example:bom:1.0")
}
} If the plugin is applied instead, we lose the need to specify the version but the syntax for importing a bom is more cumbersome: plugins {
// …
id("org.springframework.boot") version "2.1.5.RELEASE"
}
apply(plugin = "io.spring.dependency-management")
the<DependencyManagementExtension>().apply {
imports {
mavenBom("example:bom:1.0")
}
} |
I think I understand why the dependency management plugin was just applied (in order to leverage automatically the version bundled with Boot plugin) but with the new I guess the challenge here is to be able to infer |
I am not keen to have to manage the version of the plugin if that can be inferred by the Spring Boot maven plugin. This is double maintenance on our end with a very easy way of using the wrong version. |
IMO the ideal solution could be to retrieve version of plugins from Spring Boot artifact metadata, that could be used for dependency management plugin, Kotlin, etc. Not sure exactly yet how to do that (compute a cache with that info during build time?) but that would give users idiomatic Gradle build files with explicit non confusing versions defined and would improve maintenance cost. |
We can't do that as the version of Spring Boot changes dynamically according to the info in Sagan. |
For middle term solution, maybe Initializr could get the info from Sagan and/or Maven central via |
Upgrade the default dependency management plugin version as only the Kotlin DSL uses it at the moment. Ideally, we should be able to infer that one way or the other via the version of Spring Boot See spring-io/initializr#903
So we've decided to keep the declaration as it is. #977 will take care of retrieving the version from the maven metadata as we already do for Kotlin. |
Upgrade the default dependency management plugin version as only the Kotlin DSL uses it at the moment. Ideally, we should be able to infer that one way or the other via the version of Spring Boot See spring-io/initializr#903
As of Spring Boot 2, the Spring Boot plugin provides the reference of the dependency management plugin so we should just apply it rather than declaring it with a version.
At the moment, the version is wrong on start.spring.io as the version we declare is for Spring Boot 1.x.
The text was updated successfully, but these errors were encountered: