Do not load all dependencies in the dev profile
whilo opened this issue · 6 comments
I had the problem that I used system in a commercial backend with Clojure 1.9 (for spec). Since some of the dependencies in the dev profile did not comply to spec, I could not load my code. I have managed to get around by forking system and putting the deps in a different profile which is not loaded when I start a REPL, and then just providing my chosen dependencies over the regular classpath. Maybe things in the dev profile for system could use :scope "provided"
to just be loaded in the dev profile of system itself.
Does this make sense? I can open a pull-request, if you like :).
Hi Whilo,
That is an interesting problem. But I'm not sure we should break Leiningen's semantics.
In my understanding, the purpose of Leiningen's :dev
profile, and I quote, is:
The :dev profile is used to specify project specific development tooling. Put things here if they are required for builds or tests, ...
If spec
uncovers problems with dependencies, shouldn't you address those upstream?
Some of them were already adressed, but not released yet. But the point is that I usually don't use all the dependencies of system, yet somehow leiningen pulls them in even in a project's dev profile that just uses system. That is why I am proposing the [... :scope "provided"]
as this will tell leiningen that these dependencies are provided by the downstream project. That way I can control what exactly is on my classpath, while a system developer still has these dependencies in his dev profile.
User's of hasch
pointed this dependency reduction out here replikativ/hasch#1 and after I fixed it I think this is the best way . There is also a really nice talk about semantic versioning and safe dependencies from Hickey called spec-ulation btw.
Ha, yes, I loved that talk. We should all move to the line of thinking expounded in it, totally agree.
As for the suggested solution, this may very well be the way to go. I'll do some testing/validation on my side, and will proceed accordingly. Thank you!
No problem :).
0.3.2-SNAPSHOT
is deployed with a solution to this issue, I believe.
I would love a confirmation on your part, if possible. Thank you!
It works, thanks!