This message was deleted.
# general
s
This message was deleted.
v
Besides that, I would not use the spring dependency management plugin for getting the version constraints. That is imho a relict from times where Gradle did not have native BOM support. Except if you want some of the other features of the plugin like breaking transitive dependencies by porting over the broken nearest dependency wins model from Maven. Instead just use
Copy code
implementation(platform(SPRING_BOOT_BOM_COORDINATES))
šŸ‘ 2
t
OK thanks, so I've done 2 things: • moved Spring Boot dependencies to version catalog and set a blank version • used the Spring Boot platform a.k.a. bom instead of the
io.spring.dependency-management
plugin I published this sample project. Note the caveats in the README. I'd like to share it with other developers to showcase the new version catalog feature. Any further improvements you can think of?
v
To prevent the version duplication you could just use the snippet I showed. That constant is available in the build script by applying the spring boot Gradle plugin.
t
Do you mean
SPRING_BOOT_BOM_COORDINATES
? I get an unresolved reference error when I try to use this. I can't find any mention of this constant in GitHub. Did I misunderstand?
v
Ah, sorry, it is
BOM_COORDINATES
, specifically
SpringBootPlugin.BOM_COORDINATES
. I just imported it in the build script here like
Copy code
import org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES as SPRING_BOOT_BOM_COORDINATES
t
Gotcha. Agreed, this is a worthwhile improvement & I've implemented it in the sample project.
šŸ‘Œ 1
v
Your readme is outdated, the version is not duplicated anymore. You just don't keep it in the version catalog as you don't like it being painted red within IntelliJ even if it works properly. šŸ™‚
t
Ah thanks. Yes, that was my reasoning. I think it's personal preference though.
v
Yeah, nothing wrong with that šŸ™‚