https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

Arkadii Ivanov

12/21/2020, 7:44 PM
In my Decompose library, I see that starting from Kotlin version
1.4.20
the
maven-publish
plugin uploads
jar
files for root packages (named without any a suffix). But there is no
sources.jar
uploaded. As a result I can't enable JCenter sync, since sources are mandatory for packages with
jars
. E.g. this package has a
jar
file but does not have
sources.jar
file: https://dl.bintray.com/arkivanov/maven/com/arkivanov/decompose/decompose/0.1.4/ But e.g. this coroutines package has everything: https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-coroutines-core/1.4.2/ Questions: 1. Why there is no
jar
files uploaded for this package prior to Kotlin 1.4.20? (e.g. here). If there is no
jar
then it's ok to not have
sources.jar
. 2. Why there is no
sources.jar
uploaded in this case. Sources are uploaded fine for other non-root packages, e.g. the decompose-jvm.
👀 1
s

Shan

12/21/2020, 11:09 PM
I believe no sources jar is a bug with kotlin multiplatform & kotlin 1.4.21. I was able to include the sources jar manually to my common target by appending the artifact generated by
metadataSourceJar
gradle task in the publishing config
Copy code
val kotlinMultiplatform by getting {
    artifactId = "project-id"
    artifact(tasks.getByName("metadataSourcesJar")) {
        classifier = "sources"
    }
}
a

Arkadii Ivanov

12/22/2020, 10:31 AM
Thanks! Looks like this helps.
👍 1