Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a mirror of Clojars from Leiningen

The following Wiki page describes a straightforward way of setting up Leiningen to use a mirror of Clojars.org: https://github.com/clojars/clojars-web/wiki/Mirrors

Based on this, I have put the following as my ~/.lein/profiles.clj:

{:user {:mirrors 
        {#"clojars" {:name "clojars mirror" 
                     :url "https://clojars-mirror.tcrawley.org/repo/"}}}}

However, even with this profiles.clj, I can still see in e.g. Wireshark that lein is trying to connect to clojars.org instead of clojars-mirror.tcrawley.org. What setting am I missing?

My Leiningen version is

Leiningen 2.5.3 on Java 1.7.0_91 OpenJDK 64-Bit Server VM

like image 731
Cactus Avatar asked Oct 18 '22 18:10

Cactus


1 Answers

I couldn't get a mirror working by modifying profile.clj either.

However I was able to get it working for a specific project.clj by adding this within defproject

  :mirrors {#"clojars" {:name "Clojar Mirror"
                    :url "https://clojars-mirror.tcrawley.org/repo/"
                    :repo-manager true}}

Notes:

This came from the official Leiningen sample project.clj:

  • https://github.com/technomancy/leiningen/blob/master/sample.project.clj

I tried following the below for global setting in profile.clj (the syntax is somewhat different from yours) but had no luck:

  • https://github.com/technomancy/leiningen/issues/271#issuecomment-21108691
  • https://stackoverflow.com/a/17697119/617320
like image 179
jaustin Avatar answered Oct 21 '22 21:10

jaustin