I finally published my small multiplatform library...
# multiplatform
j
I finally published my small multiplatform library with iOS support.. or so I thought. Gradle build says it cannot find the
iosSimulatorArm64
artifact, even though it exists in https://repo.maven.apache.org/maven2/nl/jacobras/human-readable-iossimulatorarm64/. Instead, it's searching in this general folder https://repo.maven.apache.org/maven2/nl/jacobras/human-readable/ but that one only has 1.0.0 and 1.1.0 (which I made on my pc) and not 1.1.1 and 1.1.2 (which I made through GH Actions). Here's the build.gradle for my library: https://github.com/jacobras/Human-Readable/blob/1.1.2/build.gradle.kts Any help would be appreciated. Why is deploying a library to Maven Central such rocket science? 😔
What I also don't understand: when I run my publish GH action, it results in TWO things being in the staged repositories in Maven Central. One with everything and then one with just very specifically one iOS klib. As if it were an afterthought.
j
Check out this thread: https://kotlinlang.slack.com/archives/C19FD9681/p1695580147256459?thread_ts=1695580147.256459&cid=C19FD9681 Seems you might be experiencing a similar issue with publications being split into multiple repositories. I found using this publishing plugin https://github.com/vanniktech/gradle-maven-publish-plugin greatly simplified configuring publication. There are several other solutions in the thread as well.
💯 1
c
Hey, I had that happen as well. I switched to https://github.com/gradle-nexus/publish-plugin, which is able to recover from those issues automatically
👍 3
j
Thanks guys! I tried them both and went with the
vanniktech
one. This plugin and particularly this docs page is so clear: https://vanniktech.github.io/gradle-maven-publish-plugin/central/. If only I found it weeks ago! I now no longer have to deal with that horrible Sonatype UI too. Unfortunately, I still get this error:
I think it's because that top folder at https://repo.maven.apache.org/maven2/nl/jacobras/ still exists. It only has the first releases I did from my Windows machine, which didn't include the iOS libs. Is there any way to fix that?
Oops, I named my library
human-readable
and then didn't include that dash in the dependency when trying to use it.. 🙄 Now it works. But, thanks to that
gradle-maven-publish-plugin
I no longer have that duplicate staging repository issue and the build logic is a lot simpler. Finally I can code again! 🫠
c
Finally I can code again!
I went through the same a few months ago, I know the feeling all too well 🫠
j
Yeah, I saw it at the end of the linked chat 🥲
c
and that chat was already a few months after I started doing publishing with
maven-publish
directly 😅