Kotlin Multiplatform Development
 

Publish your library to Maven Central – tutorial

Edit pageLast modified: 17 February 2025

In this tutorial, you'll learn how to publish your Kotlin Multiplatform library to the Maven Central repository.

To publish your library, you'll need to:

  1. Set up credentials, including an account on Maven Central and a PGP key for signing.

  2. Configure the publishing plugin in your library's project.

  3. Provide your credentials to the publishing plugin so it can sign and upload your artifacts.

  4. Run the publication task, either locally or using continuous integration.

This tutorial assumes that you are:

  • Creating an open-source library.

  • Storing the code for your library in a GitHub repository.

  • Using macOS or Linux. If you are a Windows user, use GnuPG or Gpg4win to generate a key pair.

  • Either not registered on Maven Central yet or have an existing account that's suitable for publishing to the Central Portal (created after March 12th, 2024, or migrated to the Central Portal by their support).

  • Using GitHub Actions for continuous integration.