Publikowanie w Maven Central i SPM
Dystrybuuj pakiet przez Maven Central i Swift Package Manager.
Publikowanie w Maven Central i SPM to bezpłatna lekcja Kotlin Multiplatform Academy na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Kotlin Multiplatform Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Kotlin Multiplatform Academy zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
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. 🎉
Często zadawane pytania
Czy lekcja „Publikowanie w Maven Central i SPM” jest bezpłatna?
Tak — pełny tekst „Publikowanie w Maven Central i SPM” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Kotlin Multiplatform Academy, przejdź na CoddyKit PRO. Kurs Kotlin Multiplatform Academy zawiera 4 lekcji w sumie.
Co nauczysz się w „Publikowanie w Maven Central i SPM”?
Dystrybuuj pakiet przez Maven Central i Swift Package Manager. Ćwiczysz Kotlin Multiplatform Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć Kotlin Multiplatform Academy?
Nie wymagamy żadnego doświadczenia. Kotlin Multiplatform Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.
Ile czasu zajmuje lekcja „Publikowanie w Maven Central i SPM”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji Kotlin Multiplatform Academy?
Tak. Każda lekcja Kotlin Multiplatform Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Konfiguracja maven-publish dla KMP
- Dostarczanie XCFramework dla iOS
- Wersjonowanie i stabilność API
- Publikowanie w Maven Central i SPM