As part of picking up some Kotlin skills I needed to build a jar library file with Kotlin source files. I'm coming from a Java/Maven/Eclipse skill set which I know pretty well and my Kotlin tool chain involves Gradle and AndroidStudio, derived from IntelliJ. So there is quite a lot different.
Still, the task is fundamentally the same.
Maven Central has particular requirements for publishing such as supplying source, javadocs and signing everything. These are all reasonable, but doing them for Kotlin is different. I found lots of examples but nothing that took me through the whole process, whcih turns out to be reasonably easy once you know. Also there have been some changes to the process so I went down rat holes working with things that have been superseded and adding solutions to problems that are no longer there. The result is this library and the build/publish setup is tested and working and fairly simple. Lots of people have done a lot of work to make it this easy, so the credit for this goes to them, including but not limited to: https://github.com/marcphilipp/nexus-publish-plugin https://github.com/Codearte/gradle-nexus-staging-plugin