0Pricing
Kotlin Multiplatform Academy · Lesson

Release to Maven Central & SPM

Distribute via Maven Central and Swift Package Manager.

Release to Maven Central & SPM is a free Kotlin Multiplatform Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Kotlin Multiplatform Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Reach Both Ecosystems

Android devs pull libraries from Maven Central, while iOS devs prefer Swift Package Manager. A great KMP release serves both. 🌍

Claim Your Group

Maven Central verifies you own your group id, usually a reversed domain. This stops anyone else from publishing under your name.

group = "io.github.coddykit"

Sign Your Artifacts

Central requires every file to be signed with a GPG key. The signature proves the artifact really came from you and was not tampered with.

plugins { id("signing") }

Meet the Requirements

Central rejects incomplete releases. You must include sources, docs, and a POM with name, description, license, and developer details.

Point at the Central Repo

Add the Central repository with your portal credentials. The Gradle publish task then uploads every signed artifact to the staging area.

Publish and Release

Run publish to upload, then promote the staged version in the portal. After indexing, anyone can declare it as a dependency.

./gradlew publishAllPublicationsToCentralRepository

Now Serve Swift

Swift Package Manager needs a Package.swift manifest that points at your XCFramework. This is how iOS devs add your library.

Host the Binary

Upload the zipped XCFramework to a stable url, often a GitHub release. SPM downloads it from there when someone adds the package.

Describe a Binary Target

In the manifest, declare a binaryTarget with the download url and the bundle checksum so SPM can verify the file.

.binaryTarget(
    name: "Shared",
    url: "...xcframework.zip",
    checksum: "abc123"
)

Tag a Release

SPM resolves versions from git tags. Tag the repo to match your library version so consumers can pin an exact release.

git tag 1.0.0

Automate Future Releases

Manual steps drift over time. Move publishing into CI so every tagged commit signs, uploads, and updates both ecosystems the same way.

Quick Check

Let's check your release knowledge.

Recap

Sign and publish to Maven Central for Android, then host an XCFramework with a Package.swift for SPM, and automate it all in CI. 🎉

Frequently asked questions

Is the “Release to Maven Central & SPM” lesson free?

Yes — the full text of “Release to Maven Central & SPM” is free to read here on the web, and the Kotlin Multiplatform Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Kotlin Multiplatform Academy course, upgrade to CoddyKit PRO.

What will I learn in “Release to Maven Central & SPM”?

Distribute via Maven Central and Swift Package Manager. You practise Kotlin Multiplatform Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Kotlin Multiplatform Academy?

No prior experience is required. Kotlin Multiplatform Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Release to Maven Central & SPM” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Kotlin Multiplatform Academy lesson?

Yes. Every Kotlin Multiplatform Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Configure maven-publish for KMP
  2. Ship an XCFramework for iOS
  3. Versioning & API Stability
  4. Release to Maven Central & SPM
← Back to Kotlin Multiplatform Academy