kmp-library-publishing

Publish Kotlin Multiplatform libraries to Maven Central and GitHub Packages with signing and API tracking.

2|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/ronjunevaldoz/kmp-agent-skills --skill kmp-library-publishing-ronjunevaldoz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kmp-library-publishing
Source: https://github.com/ronjunevaldoz/kmp-agent-skills/tree/main/skills/kmp-library-publishing
Command: npx skills add https://github.com/ronjunevaldoz/kmp-agent-skills --skill kmp-library-publishing-ronjunevaldoz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Publishing a Kotlin Multiplatform library involves strict Maven Central POM requirements, GPG signing, Sonatype staging, and API compatibility tracking that are easy to get wrong and hard to debug when validation fails. ## Core Features & Use Cases - Maven Central Publishing: Configures the vanniktech maven-publish plugin with complete POM metadata, Sonatype OSSRH/Central Portal staging, and GPG signing. - API Stability Management: Sets up kotlinx-binary-compatibility-validator with apiCheck/apiDump workflows, explicitApi() mode, and a SemVer-aligned deprecation cycle. - Multi-Artifact Distribution: Builds a BOM for version alignment across core/compose/testing modules, plus SNAPSHOT vs stable release channels and GitHub Packages as an alternative. - Use Case: You have a KMP library with core, Compose, and testing modules and need to ship version 1.0.0 to Maven Central — this Skill generates the full build.gradle.kts, CI publish workflow, and a release checklist. ## Quick Start Set up Maven Central publishing with the vanniktech plugin, GPG signing, and binary compatibility validation for my Kotlin Multiplatform library.

Frequently Asked Questions about kmp-library-publishing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I publish a Kotlin Multiplatform library to Maven Central?▼

Use the com.vanniktech.maven.publish plugin, which handles Sonatype staging, POM generation, sources and Dokka javadoc jars, and GPG signing. Configure coordinates and the pom block in mavenPublishing, then run ./gradlew publishAllPublicationsToMavenCentralRepository.

What is the vanniktech maven-publish plugin used for?▼

It is the de-facto standard Gradle plugin for publishing KMP libraries to Maven Central. It automates Sonatype OSSRH and Central Portal staging, signing, and strict POM requirements that are error-prone to wire manually with the base maven-publish plugin.

How does binary compatibility validation work in Kotlin libraries?▼

The kotlinx-binary-compatibility-validator plugin generates .api dump files tracking every public symbol. Run ./gradlew apiDump to record the API and ./gradlew apiCheck in CI to fail builds when the public API changes without a committed dump update.

Should I publish to Maven Central or GitHub Packages?▼

Maven Central is the standard for public open-source libraries but requires a Sonatype account and GPG signing. GitHub Packages needs only a GitHub token and suits internal libraries or pre-release testing, and both can be configured together.

Why does Maven Central reject my library upload?▼

Common causes are missing POM fields (description, license, SCM, developers), unsigned artifacts, or a -SNAPSHOT suffix on a release version. The vanniktech plugin validates most of these, but the scm block and GPG key expiry are frequent failure points.

When should a KMP library be split into multiple modules?▼

Split when sub-features have genuinely independent consumer surfaces, such as a core module versus a Compose UI layer versus test fakes. Publish them as separate artifacts aligned by a BOM, and always publish via the root bulk task rather than per-module tasks.