Fork me on GitHub
#leiningen
<
2018-10-25
>
mrchance17:10:42

lein repl started hanging for me for some reason, it just doesn't do anything anymore, no error, nothing... -> Leiningen 2.8.1 on Java 1.8.0_192 OpenJDK 64-Bit Server VM Any idea why that might be?

mrchance17:10:15

I found it, was a custom artifactory which was not reachable anymore, still not the best way to handle that I suppose 😞

sam18:10:34

lein is warning me about version ranges being used by a dependency of mine. How can I resolve this, since I have no control over that dependency’s usage of version ranges?

manutter5119:10:13

Try lein deps :tree and see if that gives you any useful info

manutter5119:10:51

You might be able to exclude your dependency’s dependency, and then manually add a version that you have control over.

sam19:10:30

Thank you. Looks like I might have to follow your suggestion.

sam19:10:52

My case also seems to be an instance of this: https://github.com/technomancy/leiningen/issues/2251. Where the version range being declared by my dependency is actually a single version and they are doing it that way to guarantee that version.

sam19:10:04

I’m not sure how I feel about taking that control from the dependency. There must have been a reason for it. But it seems like there’s no other way to get rid of the warning, which is very noisy

sam19:10:18

:dependencies [
                 ...
                 [org.apache.beam/beam-runners-google-cloud-dataflow-java "2.7.0"
                  :exclusions [[io.grpc/grpc-core]
                               [io.grpc/grpc-netty]]]
                 ... 
  :managed-dependencies [[grpc-core "1.2.0"]
                         [io.grpc/grpc-netty "1.13.1"]]

sam19:10:43

@manutter51: is this what you had in mind?

mikerod19:10:10

you shouldn’t even need an exclusion for a transitive dep if you explicitly declare it

mikerod19:10:17

since that is a closer definition, so it is the one used

manutter5119:10:41

I wasn’t thinking of :managed-dependencies (which I hadn’t heard of before), but you might want to try just including the dependencies you need like mikerod says. If that doesn’t work, try adding the exclusion, and if that also fails, try the :managed-dependencies.

manutter5119:10:49

Or at least that’s what I’d do

mikerod19:10:06

:managed-dependencies just lets you share common dep declarations

mikerod19:10:17

typically with something like lein-parent plugin

mikerod19:10:31

putting things in :managed-dependencies alone doesn’t add any real dep to the project I believe

mikerod19:10:40

similar to dependencyManagement section in Maven

sam19:10:14

I still get warnings if I use :managed-dependencies and :exclusions as above. If I try to declare it in :dependencies, I get an error that the artifact couldn’t be found in maven or clojars.

sam19:10:31

*maven central

sam19:10:13

Maybe I messed up the version though… checking…

sam19:10:31

yes. my bad

sam19:10:39

@mikerod: The warnings only go away if I do the :exclusions. Adding the direct dependencies has no effect

mikerod19:10:09

it doesn’t seem like a good idea to exclude transitive deps without knowing what they are there for

mikerod19:10:16

they may be required

mikerod19:10:28

I’m surprised the warnings don’t go away, you should look at lein deps :tree though

sam19:10:30

Well, I excluded them, but I also declared them as direct dependencies of mine. So shouldn’t that address your concern?

mikerod19:10:47

oh, did both

mikerod19:10:09

yes, that works, I’m surprised you have to exclude them at all though to get rid of warning, but that’s possible if lein generates those at the wrong time I guess

mikerod19:10:30

when you directly declare a dep, your declaration wins over a dep’s dep

mikerod19:10:43

they don’t both get put on the path

mikerod19:10:08

so if it warning you about a dep’s dep that you already have overridden, that’d be superfluous warnings

sam19:10:37

hmm, well I had the impression version ranges supercede all other dependency resolution mechanisms.

sam19:10:16

I got that impression from this I guess:

In addition, version ranges introduce unexpected quirks in the dependency resolution process due to their surprising semantics around precedence; it's recommended that you avoid them entirely.
https://github.com/technomancy/leiningen/wiki/Repeatability

sam19:10:38

Although that’s pretty vague

mikerod19:10:07

don’t think so

sam19:10:48

in any case, thanks for the help and discussion

mikerod19:10:33

dang terrible

mikerod19:10:38

good link, if you go further in it

sam19:10:52

yeah, I just got to that actually

mikerod19:10:56

> Aether lets version ranges take priority over normal “soft” dependencies, and the project uses 1.5.0-alpha2 instead. Normally a direct dependency will take priority over any transitive dependencies. This situation causes a surprise for the user, who would not be expecting a transitive version range. The user has to go explicitly add an :exclusion to get the desired version of clojure. never heard that on aether

mikerod19:10:19

I guess if exclusion works then, good

sam19:10:55

yeah, thanks again to both of you. I hate this dependency management stuff.

emccue23:10:46

@mikerod Okay so whats your idea?

emccue23:10:25

(If there is another way to generate the code from the wsdl without maven im totally on board too. The maven was just the first answer I found)

mikerod23:10:20

I don’t know anything about the wsdl part

mikerod23:10:39

:pom-plugins can be put in lein project

mikerod23:10:57

So that’s get you the plugin def in a Maven Pom.xml that lein pom can generate

mikerod23:10:19

The other step would need mvn installed to run, but you could use something like the lein-shell plugin to shell out to Maven after the Pom is generated.

mikerod23:10:22

lein do pom, shell mvn <task>, <etc>

mikerod23:10:25

Could get that all happening with a lein :aliases entry and could get it done as :prep-tasks for some profile for other lein tasks that depended on it

emccue23:10:39

okay so that becomes in edn

emccue23:10:37

(giving it a shot one moment

mikerod23:10:47

Only on a phone for this right now. So not super good at typing things out

mikerod23:10:12

You can play around with if you get edn right

mikerod23:10:29

By lein pom and looking at pom generated.

mikerod23:10:59

Most of it is what you would expect on how it translates. Sometimes a few quirks