Maven CentralとSPMにリリースする
Maven CentralとSwift Package Manager経由で配布します
「Maven CentralとSPMにリリースする」はCoddyKit上の無料Kotlin Multiplatform Academyレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはKotlin Multiplatform Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
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 publishAllPublicationsToCentralRepositoryNow 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.0Automate 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. 🎉
よくある質問
「Maven CentralとSPMにリリースする」レッスンは無料ですか?
はい。「Maven CentralとSPMにリリースする」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Kotlin Multiplatform Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。
「Maven CentralとSPMにリリースする」で何を学びますか?
Maven CentralとSwift Package Manager経由で配布します ブラウザで直接実行するハンズオンコードでKotlin Multiplatform Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Kotlin Multiplatform Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのKotlin Multiplatform Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。
「Maven CentralとSPMにリリースする」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このKotlin Multiplatform Academyレッスンでコードを書いて実行できますか?
はい。すべてのKotlin Multiplatform Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- KMP向けにmaven-publishを設定する
- iOS向けXCFrameworkを出荷する
- バージョン管理とAPIの安定性
- Maven CentralとSPMにリリースする