reifyhealth / lein-git-down

A Leiningen plugin for resolving dependencies from Git
MIT License
82 stars 5 forks source link

Cannot resolve plugins from Github repository #56

Open Sardtok opened 1 year ago

Sardtok commented 1 year ago

When a plugin resides in a Github repo, it has to be downloaded and JARed by lein-git-down prior to being referenced in the list of plugins for it to work.

(defproject example "1.0.0"
  :description "Example Project"
  :url "https://example.com/example"
  :min-lein-version "2.0.0"
  :dependencies [[org.clojure/clojure "1.11.1"]
                 [Sardtok/drift "5586b939b1ab66c7dbf21a15b06815f238176079"]]

  :plugins [[reifyhealth/lein-git-down "0.4.1"]]

  :middleware [lein-git-down.plugin/inject-properties]

  :source-paths ["src"]

  :clean-targets ["target"]

  :profiles {:dev {:plugins [[Sardtok/drift "5586b939b1ab66c7dbf21a15b06815f238176079"]]
                   :main example.core}}

  :repositories [["github" {:url "git://github.com" :checksum :warn}]])

Fails with:

Could not find artifact Sardtok:drift:jar:5586b939b1ab66c7dbf21a15b06815f238176079 in central (https://repo1.maven.org/maven2/)
Could not find artifact Sardtok:drift:jar:5586b939b1ab66c7dbf21a15b06815f238176079 in clojars (https://repo.clojars.org/)
Could not transfer artifact Sardtok:drift:jar:5586b939b1ab66c7dbf21a15b06815f238176079 from/to github (git://github.com): Cannot access git://github.com with type default using the available connector factories: BasicRepositoryConnectorFactory
Failed to read artifact descriptor for Sardtok:drift:jar:5586b939b1ab66c7dbf21a15b06815f238176079
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

If I remove the Sardtok/drift plugin from the dev profile, the artifact is downloaded. I can then add it back in, and it works as expected. If I ever update the plugin, I have to comment it out to update the deps, and then comment it back in.

This isn't a huge issue, but it would be nice to be able to get plugins from Git. In this case it's an updated version of Drift that works with Java 9+. Sure I could publish it to our private Nexus server, but we are trying to move away from using it.

Not sure if it's possible for lein-git-down to run before other plugins are resolved, or if there is a solution to this problem that isn't publishing the plugin.