<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oleksii Libin on Medium]]></title>
        <description><![CDATA[Stories by Oleksii Libin on Medium]]></description>
        <link>https://medium.com/@a_libin01?source=rss-1f4be2f4f249------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gH-yiOFMQhkSixR3o2nl1Q.jpeg</url>
            <title>Stories by Oleksii Libin on Medium</title>
            <link>https://medium.com/@a_libin01?source=rss-1f4be2f4f249------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:24:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a_libin01/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Add a Swift Package from JFrog Artifactory to an Xcode Project]]></title>
            <link>https://medium.com/@a_libin01/how-to-add-a-swift-package-from-jfrog-artifactory-to-an-xcode-project-058ee0678b64?source=rss-1f4be2f4f249------2</link>
            <guid isPermaLink="false">https://medium.com/p/058ee0678b64</guid>
            <category><![CDATA[artifact-registry]]></category>
            <category><![CDATA[jfrog-artifactory]]></category>
            <category><![CDATA[swift-package]]></category>
            <category><![CDATA[swift-package-manager]]></category>
            <category><![CDATA[artifactory]]></category>
            <dc:creator><![CDATA[Oleksii Libin]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 18:03:53 GMT</pubDate>
            <atom:updated>2025-08-14T11:28:12.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*93gVxog46eP-_1q6pbBcuA.avif" /></figure><h3>Introduction</h3><p>In this guide, I’ll explain how to integrate Swift Packages into a project using JFrog Artifactory. Before writing this article, I researched just about everything available on this topic, and I can say with confidence: the problem exists, and people are solving it incorrectly. You can find many articles that will only confuse you by providing incorrect information (including the official JFrog Artifactory docs). That’s why I decided to create this guide, clearly and step-by-step, to finally close the issue once and for all.</p><h3>Problem</h3><p>JFrog Artifactory claims it has supported the Swift Package Registry for over two years. This is a big win for companies already using Artifactory to distribute binaries to clients. As an iOS developer, I’ve already received requests for urgent Swift Package Registry integration in Artifactory at two different companies.</p><p>While publishing a Swift Package to Artifactory isn’t particularly difficult, integrating it into a project is highly problematic. The main issue: the package can be integrated as a <strong>package-to-package</strong> dependency, but integrating it directly into an <strong>Xcode project</strong> causes a number of issues (ironically, everyone blames Xcode and Apple for this).</p><h3>Work Plan</h3><ol><li>Setting up Artifactory</li><li>Creating a Swift Package and Preparing the Environment</li><li>Publishing the Swift Package to Artifactory</li><li>Integrating the Swift Package into our Client App</li><li>Summary and Conclusions</li></ol><h3>1. Setting up Artifactory</h3><p><em>You can skip this step if you’ve already set up your Artifactory instance, but I intend to walk through the entire process in detail to eliminate any confusion.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XK7r3vJzUl7uT2OLSmMk9g.png" /></figure><p>Go to <a href="https://jfrog.com/start-free">this link</a> and choose the <strong>14-Day Free Trial <em>for technical evaluation</em></strong> option. You’ll see a registration screen asking for your email, first name, and last name.</p><p>Next, you’ll be taken to a screen where you choose a domain name (you can use the suggested one or create your own — I used “oleksii”) and select a hosting option — it doesn’t matter which.</p><p>You’ll then see a <strong>Welcome screen with a Step-by-Step Guide</strong>. In the <strong>Package Management</strong> section, choose <strong>“Create your first Repository”</strong>, then select <strong>Swift</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCWaBjoLsJStEUiClNiPOg.png" /><figcaption><em>Local and Virtual repository creation</em></figcaption></figure><p>Specify a <strong>Repositories prefix</strong> (I used “my”) and click <strong>Create</strong> — this is the quickest way to create the two repositories we need: <strong>virtual</strong> and <strong>local</strong>.</p><p>Next, go back to the <strong>Step-by-Step Guide</strong> and select <strong>“Connect a developer client”</strong>. You’ll be asked to enter your account password to generate a token. Do this, copy the token, and save it — you’ll need it later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9-gXfiGgVIq27XJmxiwaPg.png" /><figcaption>Token generation for future integration</figcaption></figure><p>That was it for the Artifactory setup!</p><h3>2. Creating a Swift Package and Preparing Environment</h3><p>Next, we’ll create the Swift Package we’ll be publishing to Artifactory.<br><em>Go </em><strong><em>Xcode</em></strong><em> → </em><strong><em>File</em></strong><em> → </em><strong><em>New</em></strong><em> → </em><strong><em>Package</em></strong><em>.</em><br>Create the Swift Package and open its directory in Terminal.</p><p>In Terminal, we need to set the Swift package registry file. Run the following command:</p><pre>swift package-registry set &quot;https://oleksii.jfrog.io&quot;</pre><blockquote>Don’t forget to replace hosting name “oleksii” with your own one.</blockquote><p>This command creates a hidden .swiftpm directory in the project root. Use Cmd+Shift+. if you can’t see it.<br>Navigate to .swiftpm/configuration/registries.json — this file describes your Swift Package Registry. You don’t need to make any changes to it.</p><p>Next, we need to make this registry <strong>globally available</strong> so other projects on your machine can access it:</p><pre>swift package-registry set --global &quot;https://oleksii.jfrog.io&quot;</pre><p>Great! Now our global .swiftpm directory contains specified Swift Registry configuration. To work with it, we need to <strong>log in</strong> using the token you saved earlier:</p><pre>swift package-registry login &quot;https://oleksii.jfrog.io/artifactory&quot;</pre><p>You’ll be prompted to enter a password — this is where you enter the token from Artifactory. The command logged us in and <strong>saved the credentials in the Keychain</strong>.</p><blockquote>⚠️ <strong>Important:</strong><br>You <strong>don’t</strong> need to store credentials in a .netrc file — system will ignore it.<br>You <strong>don’t</strong> need to manually store anything in the Keychain — it happens automatically.</blockquote><p>If everything went well, you’ll see messages like:</p><ul><li>“Login successful”</li><li>“Credentials have been saved to the operating system’s secure credential store”</li><li>“Registry configuration updated”</li></ul><p>this means your login info was updated, and the contents of registries.json in the root differ from the one in the package directory.</p><h3>3. Publishing the Swift Package to Artifactory</h3><p>Now we need to archive the package and publish it to Artifactory.</p><p>Artifactory has a strict system for tracking name, id, and version. I won’t go into detail here — it’s all available in the docs.</p><p>To archive the package (inside the project folder), run:</p><pre>swift package archive-source -o &quot;MyPackage-1.0.0.zip&quot;</pre><p>If you see the message <strong>“Created MyPackage-1.0.0.zip”</strong>, you’re good to go.</p><p>To publish, you’ll need the full project name including its ID. I’m using swift as the id:</p><pre>swift package-registry publish swift.MyPackage 1.0.0 --url https://oleksii.jfrog.io/artifactory/api/swift/my-swift</pre><p>If you see the message: <em>“swift.MyPackage version 1.0.0 was successfully published to https://oleksii.jfrog.io/artifactory/api/swift/my-swift”</em>— congrats, it worked!</p><p>If you get an error like: “<em>Error: publication failed: forbidden”</em><strong><em> </em></strong>— it most likely means your firewall is blocking communication. Check your network settings.</p><p>Once the package is published, you can visit your Artifacts page (mine was <a href="https://oleksii.jfrog.io/ui/repos">https://oleksii.jfrog.io/ui/repos</a>) and see your package in both the <strong>virtual</strong> and <strong>local</strong> repositories.</p><h3>4. Integrating the Swift Package into our Client App</h3><p>This is the final step — for many, the most problematic, but in reality, it’s the easiest.</p><p>Create a new project:<br><strong>Xcode</strong> → <strong>Create new Project</strong> → <strong>App</strong></p><p>Then go to:<br><strong>File</strong> → <strong>Add Package Dependencies</strong></p><p>In the search field, <strong>manually type</strong> your package name <strong>exactly</strong> as it’s stored in Artifactory:<br>swift.MyPackage<br>Then press <strong>Enter</strong>.</p><p>The system will probably ask for Keychain access — enter your user password.<br>After that, you should see your package in the list!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjBqrl8Gj3u9Sq34xvPb7A.png" /></figure><h3>5. Summary and Conclusions</h3><p>As you can see, we didn’t need to manually add credentials to .netrc, configure Keychain, or edit registries.json — the system does it all for us, <strong>as long as we don’t interfere</strong>.</p><p>I also want to clarify a common point of confusion: <strong>local vs. virtual repository</strong>. In this process, we only used the <strong>virtual </strong>repository, so you <strong>do not</strong> need to reference the local repository in any point.</p><p>I sincerely hope this article was helpful and that I’ve put an end to the long and painful developer debates around this issue.<br>Below, you’ll find links where you can explore the problem and the proposed solutions in more detail.</p><h3>Links made me create this article</h3><ol><li><a href="https://github.com/swiftlang/swift-package-manager/issues/6395"><em>Xcode 14.3 doesn’t use credentials for auth to a package registry</em></a></li></ol><p>2. <a href="https://github.com/swiftlang/swift-package-manager/issues/7237"><em>Xcode 15.1 — not able to add private package dependencies to app project</em></a></p><p>3. <a href="https://forums.swift.org/t/package-registry-support-in-xcode/73626"><em>Package registry support in Xcode</em></a></p><p>4. <a href="https://forums.swift.org/t/pitch-package-registry-authentication/61047"><em>Package Registry Authentication</em></a></p><p>5. <a href="https://albertodebortoli.com/2025/06/06/how-to-setup-a-swift-package-registry-in-artifactory/"><em>How to setup a Swift Package Registry in Artifactory</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=058ee0678b64" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>