Slackbot
05/30/2023, 12:43 PMVampire
05/30/2023, 1:01 PMbuildSrc
is made even more similar to an included build.
But I personally would still prefer an included build.Sebastian Schuberth
05/30/2023, 1:06 PMbuildSrc
, and I'm running into an issue when trying to apply detekt as part of my conventional plugin. Apparently, applying "io.gitlab.arturbosch.detekt:detekt-gradle-plugin" also requires to apply "org.jetbrains.kotlin:kotlin-gradle-plugin", but if I do, I get The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
Am I correct to assume that this problem will disappear with an included build as the latter is no implicitly on the classpath of all projects like buidSrc
is?Adam
05/30/2023, 1:22 PMSebastian Schuberth
05/30/2023, 1:23 PM* What went wrong:
Error resolving plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.8.21']
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
Sebastian Schuberth
05/30/2023, 1:24 PMAdam
05/30/2023, 1:24 PMbuildSrc/build.gradle.kts
dependencies {}
?Sebastian Schuberth
05/30/2023, 1:25 PMAdam
05/30/2023, 1:25 PMplugins {}
blocks, in subprojects and in pre-compiled script plugins
plugins {
kotlin("jvm") // no need for a version - it's defined in buildSrc/build.gradle.kts
}
Sebastian Schuberth
05/30/2023, 1:25 PMdependencies {
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
// See <https://docs.gradle.org/current/samples/sample_convention_plugins.html#applying_an_external_plugin_in_precompiled_script_plugin>.
implementation(libs.detektPlugin)
implementation(libs.kotlinPlugin)
}
Vampire
05/30/2023, 1:29 PMbuildSrc
it should probably always be unknown as it does not take part in conflict resolution but is just prepended to the classpaths using a parent class loader.
But removing all other plugin versions like Adam suggested might also make it work with buildSrc
, yes.Sebastian Schuberth
05/30/2023, 1:29 PMif so, then you just have to remove the version from allThanks, looks like that was the missing bit.blocks, in subprojects and in pre-compiled script pluginsplugins {}
Daniele Segato
05/30/2023, 4:06 PM