I am using a buildSrc
module in a multi-module Kotlin project to manage dependency definitions and versions. The module makes use of kotlin-dsl as shown in the build.gradle.kts:
plugins {
`kotlin-dsl`
}
Alternative declaration:
plugins {
id("org.gradle.kotlin.kotlin-dsl") version "0.16.2"
}
I would like to use the same Kotlin version for compiling the buildSrc
module as well as within the application module/s. My first attempt was to simply add the JVM artifact:
plugins {
`kotlin-dsl`
kotlin("jvm") version "1.2.31"
}
This however leads to a build error which is discussed here:
Error resolving plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.2.31']
Plugin request for plugin already on the classpath must not include a version
What is a convenient way to only define once the Kotlin version used throughout the project?