Fork me on GitHub
#tools-deps
<
2018-06-20
>
gfredericks16:06:04

I just encountered my first instance of a clojure library only being available via github

gfredericks16:06:07

i.e., it's not on clojars

gfredericks16:06:16

you are expected to use it by specifying the github repo and a sha

seancorfield16:06:54

The Cognitect Labs test-runner is like that -- but I assume you mean "aside from clj-specific tooling"?

seancorfield16:06:25

(also my clj-new is not on Clojars but, again, clj-specific tooling)

kenny18:06:27

Can I specify a username and password for a Maven repo?

seancorfield18:06:47

@kenny In settings.xml I believe...

kenny18:06:08

Not in a deps.edn?

seancorfield18:06:36

You certainly don't want your Maven creds in your project's deps file under version control.

kenny18:06:49

Via environment variables.

seancorfield18:06:10

deps.edn is static EDN, no variables.

kenny18:06:49

So there is no way to use private Maven repositories? Or does tools-deps read in settings.xml?

seancorfield19:06:36

I haven't tried it myself (and haven't seen specific documentation about it).

seancorfield19:06:14

@kenny I haven't read through all of the details but this is the JIRA issue that covers this https://dev.clojure.org/jira/browse/TDEPS-9

seancorfield19:06:17

Looks like it relies on Maven's standard settings.xml file according to the patch in that ticket.

kenny19:06:43

Got it, thanks!

Alex Miller (Clojure team)19:06:13

yes, that is all correct

seancorfield19:06:38

(it was a TIL moment for me so thank you for asking @kenny!)

Alex Miller (Clojure team)19:06:59

For Maven deps in authenticated repositories, existing Maven infrastructure is used to convey credentials via the ~/.m2/settings.xml:

  <servers>
    …
    <server>
      <id>my-auth-repo</id>
      <username>zango</username>
      <password>123</password>
    </server>
    …
  </servers>

Then in your deps.edn include a repo with a name matching the <id>:

{:deps
 {authenticated/dep {:mvn/version "1.2.3"}}
 :mvn/repos
 {"my-auth-repo" {:url ""}}}

4
seancorfield20:06:25

Thanks. I'd searched for settings.xml earlier and couldn't find anything in the guides or reference.

hagmonk19:06:54

is it not possible to specify relative paths in :local/root?

hagmonk19:06:33

I'm trying to use lein-tools-deps to point to two different deps.edn, one of which points at the other via relative path

hagmonk19:06:48

could be a lein-tools-deps bug …

Alex Miller (Clojure team)19:06:18

there are some known issues with local to local and relative paths

Alex Miller (Clojure team)19:06:23

particularly around :paths

cfleming19:06:46

@alexmiller Just a gentle reminder about the module naming issue, you said you had had discussions about this in the context of git deps.

Alex Miller (Clojure team)20:06:16

yeah, haven’t had time, and won’t today. but I haven’t completely forgotten

hagmonk20:06:38

changing :local/root to be an absolute path resolved things for lein-tools-deps. Hum.

hagmonk20:06:31

Oh cute, I got it working

hagmonk20:06:09

Solution is to not specify the deps.edn files directly in project.clj, just leave it as :project. Then, make an uber deps.edn that points at the deps.edn files. Things resolve as expected

rickmoynihan22:06:39

Glad you got this working; if you think it’s a bug though please file an issue with lein-tools-deps As Alex says, there’s some open bugs on tools.deps itself to do with paths, so could be that; but could also be due to us resolving paths relative to :project… would need to have a test case to recreate