This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-17
Channels
- # beginners (51)
- # boot (31)
- # cider (14)
- # clara (13)
- # cljs-dev (15)
- # cljsjs (2)
- # cljsrn (53)
- # clojure (18)
- # clojure-dusseldorf (1)
- # clojure-russia (4)
- # clojure-uk (9)
- # clojurescript (53)
- # cursive (3)
- # datomic (5)
- # docs (1)
- # figwheel (2)
- # fulcro (42)
- # hoplon (3)
- # lein-figwheel (3)
- # leiningen (53)
- # off-topic (1)
- # om (4)
- # re-frame (11)
- # shadow-cljs (8)
OK, I think I've seen something about this issue before - probably in #clojure channel, but this seems more appropriate. I didn't pay much attention before, because I had never hit this issue. Anyway, I have lib that I created (does use both clj and cljs). Works fine if I am just running in development - no jars just direct from source. OK, so I then create a jar for it and deploy (locally for now - that works fine for me on all sorts of other stuff). If I include this as a dependency in some new project, it seems to bungle the classpath so that unless something is in the lib's jar or directly in the new projects project.clj it is not visible. I tried with and without :aot, with lein jar and lein uberjar (with and without :aot)
Ran out of ideas and thought that this sort of thing I've seen reported before. Any clues much appreciated
uberjar should not be used for libraries; there are edge cases for using aot with libraries but it is tricky and probably not worth the trouble
how are you adding the dependency to the other project?
@noisesmith Thanks for info. Adding the dependency in new project's project.clj in its dependency vector with this: [vgl "0.1.0"]
can you run lein deps :tree
in the second project (the one with that dep) - you should see various libraries under that one in the tree
OK, let me do that - I did run that before, but was only looking at conflicts
OK, just ran it and - nothing under it. Just the single [vgl "0.1.0"]
and nothing else.:thinking_face:
and it has deps, that the parent project doesn't pull in, that as a result are not available?
what does the pom.xml that lein install
generates look like? this is the document that specifies deps, it gets put beside your jar under ~/.m2/repository/
yes, that definitely seems to be the case. Must be something broken with it's (lib) project.clj??
let me check that
if the pom.xml doesn't have your deps specified in it, that would indicate a problem
I'm guessing it doesn't, but let me see
wow, there is no pom there: `dir ~/.m2/repository/vgl/vgl/0.1.0/ total 8768 -rw-rw-r-- 1 jsa jsa 149 Sep 17 13:02 _maven.repositories -rw-rw-r-- 1 jsa jsa 8970247 Sep 17 13:02 vgl-0.1.0.jar`
the local deploy has nothing either...
oh, it is actually vgl-0.1.0.pom that you would see
Yeah, I don't see that anywhere...
what about if you run lein pom?
I mean, lein install should be making and renaming that pom for you...
just trying to figure out where this is breaking down
OK, never done that before - should I run that in lib or new project or??
in the lib - lein pom
generates the pom.xml
file that eventually becomes lib.pom
and other apps use that file to figure out what your deps are
makes sense - running now
it generated it and there is a lot of stuff in there
weird, running lein install
should have put that in the cache with your jar (which is clearly there...)
wait a minute, I didn't run lein install, just lein deploy to lcldir in new proj director and then just lein deps. it did say it was fetching from lcl but maybe I need to run lein install after lein deploy?
Also, I do see the pom in the jar
right but dep management doesn't open the jar
I don't know how your local repo works, I have literally never needed one, lein install
does everything I've needed
I think I've hit the current limit of my deps mgt knowledge.
@jsa-aerial see what happens if you remove the project from your local repo (or bump version and ask for new version) and run lein install
from your lib
that should just do the right thing with no complications in my experience
Here's what I've used : lein deploy lclrepo vgl 0.1.0 /path/to/jar/vgl-0.1.0.jar
do what I suggested, it's simpler
just try it
you don't need a local repo for this
Sounds good - I do this in the library dir?
right
dang - should I have removed the current m2 version?
no, running install overwrites the m2 cache
OK, I've got my self in a tangle removing everything and cleaning. So, the steps are simply 1) lein jar and then 2) lein install?
no, there's only one step lein install
then you go start your other project
OK, thanks
it's really a lot simpler than people expect and I think this leads to problems
because people expect installing a local dep to be weird and complicated, so they go find weird complicated solutions haha
pom and jar are now there in the .m2 .... area trying new project
the one gotcha for using any local cache is that if you are deploying and expect others to be able to resolve your dep, you need to remember to push up a new version of your artifact to the shared repo when pushing code that uses it (it's easy to forget and say "it works for me" because you did a local install, which is a pain for the rest of the team)
I see. I think it is working - better, for some value of 'better'.
I think what is now messed up is that in attempting to 'fix' this before, I peppered the dependencies with all sorts of exclusions and one of those seems to have been excluded altogether...
oh, that sounds easy to fix though
@noisesmith Many Many Thanks for helping with this!!