```plugins { ...
# spring
d
Copy code
plugins {                                                                                                                                                            
    val kotlinVersion = "1.2.20"                                                                                                                                     
    val springBootVersion = "1.5.9.RELEASE"                                                                                                                          
    val springDependencyManagementVersion = "1.0.4.RELEASE"                                                                                                          
                                                                                                                                                                     
    idea                                                                                                                                                             
    kotlin("jvm") version kotlinVersion                                                                                                                              
    id("io.spring.dependency-management") version springDependencyManagementVersion                                                                                  
    id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion                                                                                                   
    id("org.springframework.boot") version springBootVersion                                                                                                         
}
c
this does not solve declaring Kotlin version in one place though, what if you need to specify it elsewhere in build.gradle.kts for some library or to force it in spring plugin management (
extra["kotlin.version"]= ???
)
d
You are right of course, we do declare it twice, of course (since variables in the plugin block aren't global).
c
If you haven't yet, look at this same discussion in #gradle there are couple of ways to do it only once.