I get this unhelpful error saying "Plugin request ...
# gradle
t
I get this unhelpful error saying "Plugin request for plugin already on the classpath must not include a version". If I remove the version number from the child project I get " Plugin [id: 'org.jetbrains.kotlin.jvm'] was not found in any of the following sources:" So how do I plugin Kotlin across multiple modules without that version number clashing?
t
I believe what you should do (and 100% works for us), is declare but not apply the plugin in the root, like this:
Copy code
plugins {
	id "org.jetbrains.kotlin.jvm" version "1.3.20" apply false
}
Then in your child module just
apply plugin: 'kotlin'
n
you can also add the plugin child modules by leaving out the version
Copy code
plugins [
    kotlin("jvm")
}
on the children its silly, it should realize that it is the same version and just apply it
t
@tddmonkey Is there a way to do that with Kotlin DSL?
t
There should be, but I use the Groovy one so can’t help. I’ll check if some of our other projects do it
One I dug out from another team:
Copy code
plugins {
    idea
    kotlin("jvm") version "1.3.11"
}
in subproject
Copy code
apply {
        plugin("kotlin")
    }
t
Alright thanks, this was very helpful. I did a minimal example here: https://github.com/thomasnield/kotlin_gradle_dsl_multiproject_examples