how do I fix missing javadoc jar errors on maven c...
# multiplatform
e
how do I fix missing javadoc jar errors on maven central?
p
I don’t remember exactly what I did, but this article helped me a whole lot with basically all questions regarding publishing a lib to maven central: https://proandroiddev.com/publishing-android-libraries-to-mavencentral-in-2021-8ac9975c3e52
e
thanks but I feel my problem just falls outside of the scope of this article as it seems to be an mpp issue
r
Do you use dokka plugin?
I'm using this configuration in my project to publish javadoc jars: https://github.com/rjaros/kvision/blob/master/build.gradle.kts#L57-L74
👍 1
e
I do use dokka plugin. You can check my gradle configuration here: https://github.com/openrndr/openrndr/blob/master/build.gradle
It is a bit complex as it is a mix of mpp / jvm subprojects
can this be done without dokka? I have a lot of problems using dokka
(it is slow and occasionally runs out of memory)
r
As far as I know maven central only checks the existence of the javadoc jar, not its content. So you could probably just create empty jars for your artifacts and publish them.
👆 1
e
yeah that's what I am at now 🙂 I am wondering though, how much does that cripple user experience?
seeing that I haven't had working javadoc jars for my local publications.. not much?
Thanks for your pointers @Robert Jaros they have helped me a lot
e
this will create a javadoc jar:
Copy code
val javadocJar by tasks.registering(Jar::class) {
    from(tasks.dokkaJavadoc)
    archiveClassifier.set("javadoc")
}
...
artifact(javadocJar)
simpler than Robert's solution, because Gradle already knows how to handle task outputs as files, and get a task from a task provider