Don't set the default Maven coordinates that are derived from project

In Gradle, a publication's Maven coordinates are by default derived from
the project. Setting them explicitly breaks the link, and the
coordinates are no more updated when the project's group and version
change.

Setting the coordinates in our code breaks with Gradle Kotlin DSL, where
the plugin is applied before the build script can even update the
project's group and version -- our code could set empty values, which
would update no more. Not setting them helps: the values are still
delegated to the project.
This commit is contained in:
Sergey Igushkin
2018-11-20 16:38:31 +03:00
parent a3b50e33b8
commit 88fa85fc1f
@@ -162,9 +162,6 @@ class KotlinMultiplatformPlugin(
val rootPublication = publishing.publications.create("kotlinMultiplatform", MavenPublication::class.java).apply {
from(kotlinSoftwareComponent)
(this as MavenPublicationInternal).publishWithOriginalFileName()
artifactId = project.name
groupId = project.group.toString()
version = project.version.toString()
}
// Publish the root publication only if Gradle metadata publishing is enabled:
@@ -186,8 +183,6 @@ class KotlinMultiplatformPlugin(
}
(this as MavenPublicationInternal).publishWithOriginalFileName()
artifactId = variant.target.defaultArtifactId
groupId = project.group.toString()
version = project.version.toString()
}
variant.publicationDelegate = variantPublication