Swift Repositories
Swift Repositories
Swift Package Manager (SPM) is Apple’s official dependency manager for Swift projects. It manages the distribution of Swift code and automates downloading, compiling, and linking dependencies. For enterprise Swift development, integrating SPM with Sonatype Nexus Repository Manager enables centralized, cache-backed, and policy-aware repository management.
See Swift Package Manager Documentation
Nexus Repository integrates with SPM by implementing the Swift Package Registry API allowing repository management for both
- ID declaration
(.package(id: "alamofire.alamofire", exact: "5.7.0") - Git URL declaration
(.package(url: "https://github.com/alamofire/alamofire.git", from: "5.7.0")
Swift format is available in both Pro and Community editions and supports authenticated and anonymous access.
Getting Started with Swift in Nexus
Explore the following topics to know how to configure and use Swift with Nexus.
Note
To use Nexus with Swift, ensure you are running Swift Package Manager 5.7 or later. Sonatype recommends using SPM version 5.9 or higher.
Nexus for Swift
- Proxy Repository: Centralize access to public Swift packages through Nexus proxy repositories
- Hosted Repository: Supports uploading Swift packages as
.zipfiles and MIME type validated - Group Repository: Aggregate multiple Swift repositories (proxy/hosted/group) into one endpoint
- Improve build performance through caching
- Reduce reliance on external Git hosting services
- Apply enterprise controls such as access management and auditing
- Supports anonymous access
- Supports authentication through username and password (Pro and Community Editions)