Fork me on GitHub
#tools-deps
<
2019-12-02
>
mike_ananev04:12:34

Hi! Is there any way to build WAR using tools deps? I know only leiningen plugin for building war, but it is not convenient to use both tools.

seancorfield04:12:47

But a WAR is "only" a JAR/ZIP with some additional metadata files in it...

dominicm08:12:20

Someone requested it for pack, but I never got round to it because I'm not very familiar with war. I think it should be straightforward using the internal API, because the layout is very similar to the other supported types.

didibus21:12:34

How does tools.deps resolve conflicts for git deps and local deps ?

seancorfield21:12:17

I believe it can't resolve conflicts across different types of deps? For two git deps it can resolve to the "most recent SHA" I think. Not sure how it would handle two conflicting local deps.

Alex Miller (Clojure team)23:12:58

Git - newest wins, local - nothing implemented now but I think that is rare

4
seancorfield21:12:56

I can't find a JIRA issue for this. @alexmiller is there an issue for this that I'm just not seeing? Or is this one of those "known issues" that hasn't gotten as far as JIRA yet?

Alex Miller (Clojure team)23:12:49

There is a ticket similar to this but I could not repro it last week, hoping to clarify soon

4
seancorfield21:12:12

@didibus It feels like a local dep should always be preferred over a git dep which in turn should be preferred over a Maven/Clojars dep but maybe that's just my misguided intuition...

didibus22:12:07

Ya, it can be tricky. I wonder if introducing a deps concept of version could help, like if you declared the version in deps.edn

didibus22:12:40

Now it could be used to compare across revolvers

didibus22:12:49

Another thing could be to allow to specify a version when the resolver has no concept of it. So I declare a local deps, maybe I could also tell tools.deps what version it is

didibus22:12:13

But that one would seem more confusing

Alex Miller (Clojure team)23:12:34

Yeah, not planning to do that. Most Maven artifacts include their shas (central enforces, not sure if Clojars does) which gives you comparison basis w git deps (even across forks)

Alex Miller (Clojure team)23:12:12

Not all cases will be resolvable - in that case it’s an error and you (human) must resolve by picking one via top dep or override

seancorfield23:12:09

@alexmiller Does that mean that if you have a :git/url and a :mvn/version and the pom.xml for the latter includes a <tag> that t.d.a. currently resolves that to a SHA and figures out whether it's before/after the :git/url's :sha? Or is that just speculative "t.d.a. could maybe do this perhaps"?

seancorfield23:12:03

(I'm guessing that it's speculative and in many cases it could not resolve that anyway because there isn't always valid tag/scm information in the POM anyway)

Alex Miller (Clojure team)23:12:38

There usually is scm info

Alex Miller (Clojure team)23:12:55

I have not yet implemented this but all the pieces are already there