Him188 / maven-central-publish

Configure publication to Maven Central for Gradle projects with minimal effort.
Apache License 2.0
24 stars 6 forks source link

Kotlin compiler dependency is overridden by this plugin #4

Closed Him188 closed 3 years ago

Him188 commented 3 years ago
plugins {
    kotlin("multiplatform") version "1.5.10"
    id("net.mamoe.maven-central-publish") version "0.4.2"
}

Gradle 6.8.3 uses Kotlin 1.4.30 from this plugin instead of 1.5.10 declared by the user.


This plugin depends on Kotlin compiler: https://github.com/Him188/maven-central-publish/blob/3f0ca77459d8e4a5ef5a511a4907f6be14516e5d/plugin/build.gradle.kts#L30

so when applied, Kotlin 1.4.30 will present in the compiler classpath.

If I change it to compileOnly:

compileOnly(kotlin("gradle-plugin-api").toString())

the consumer should not receive Kotlin 1.4.30 but Gradle tests fail for the plugin for the reason "unable to resolve Kotlin plugin"