If you ever want to access the spring version that spring boot is using to download dependencies, you can access it via dependencyManagement in gradle. For example in gradle kotlin dsl

val springVersion = dependencyManagement.importedProperties["spring-framework.version"]

dependencies {
    implementation("org.springframework:spring-context:$springVersion")
}

That way you don’t need to manage a seperate version string for Spring dependencies that aren’t included in boot starters.

For more information about the Spring dependency management plugin see their reference documentation. For a full list of properties to access see the Spring Boot POM file.