Fork me on GitHub
#leiningen
<
2017-04-26
>
noonian01:04:47

Is it possible to configure private maven repos so that lein new ... will search them when resolving template names? I’ve tried :repositories and :plugin-repositories in my :user profile but it isn’t working for me and the output only mentions searching maven central and clojars. There’s a chance I’ve misconfigured artifactory so I’m wondering if anyone has had success with this.

danielcompton02:04:38

Can you share your (redacted) config?

danielcompton02:04:10

Actually, I think I've run into this in the past, and we had to publish our lein templates to Clojars

danielcompton03:04:39

Following the code path through leiningen.new it all seems like it should work

danielcompton03:04:57

I suspect the problem is in leiningen.new/fake-project

danielcompton03:04:13

It looks like it would use your :plugin-repositories from :user

noonian03:04:19

{:user
 {:dependencies [[org.clojure/tools.namespace "0.2.10"]
                 [pjstadig/humane-test-output "0.7.0"]]
  :injections [(require 'pjstadig.humane-test-output)
               (pjstadig.humane-test-output/activate!)]
  :plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]
  :plugin-repositories
  [["snapshots" {:url ""}]
   ["releases" {:url ""
                :sign-releases false}]]}}

noonian03:04:15

I have the Artifactory docker image running on a local kubernetes cluster (minikube)

danielcompton03:04:21

which seems to be fixed

noonian03:04:16

Yeah, I saw that also. This 2015 thread implies its :plugin-repositories as well, but I couldn’t get it working: https://groups.google.com/forum/#!topic/clojure/FXohCZjriN0

noonian03:04:20

Here’s the output with repos configured in :plugin-repositories:

bash-3.2$ lein new my-template foo
lein new my-template foo
(:repositories detected in user-level profiles! [:user] 
See 
Failed to resolve version for my-template:lein-template:jar:RELEASE: Could not find metadata my-template:lein-template/maven-metadata.xml in local (/Users/jed/.m2/repository)
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Could not find template my-template on the classpath.

martyglaubitz11:04:36

clojure/lein newbie here: is there an easy way to find the latest version of an dependency via lein search other than manually paging through all search results?

jumar11:04:15

@martyglaubitz not exactly the answer to your original question, but there is https://github.com/xsc/lein-ancient plugin which will report the outdated dependencies. I also often use cljr-add-project-dependency in Spacemacs which will automatically list the most recent versions at the top

martyglaubitz12:04:48

@jumar yeah usually i rely on my IDE (i use IntelliJ + Cursive) to show me whats available, but sometimes i don't have more than leiningen itself to search..