Sebastian Boldt
Sebastian Boldt

Reputation: 5321

Pod install installs pod from wrong spec repository

We created a private pod called ListKit und put it into our private cocoapods repository.

The Cocoapod Documentation says:

"The order of the sources is relevant. CocoaPods will use the highest version of a Pod of the first source which includes the Pod (regardless whether other sources have a higher version)."

We included both spec sources on top of the Podfile like so: (our own repo is the first on the list)

source 'ssh://[email protected]:7999/customspec.git'
source 'https://github.com/CocoaPods/Specs.git'

For some reason ListKit of the Cocoapods Master Spec Repository will be used if i run pod install instead of the ListKit from our private spec repository.

Is this intentional or a bug?

I use Cocoapods Version: 1.5.3 on Mac OS 10.13.2

Upvotes: 1

Views: 372

Answers (1)

Cœur
Cœur

Reputation: 38667

See the doc at https://guides.cocoapods.org/syntax/podfile.html#pod. You can directly set an individual source for a specific pod to disambiguate this situation:

pod 'ListKit', :source => 'ssh://[email protected]:7999/customspec.git'

As for why it is originally fetching from the second repository instead of the first repository, it may be a bug, or it may be that another pod using the Master Spec Repository had a dependency on 'ListKit', or it may be that no pod matching the requirements of 'ListKit' could be found in the first repo.

Upvotes: 1

Related Questions