This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-22
Channels
- # announcements (1)
- # aws (2)
- # babashka (52)
- # beginners (35)
- # calva (20)
- # clj-kondo (13)
- # cljdoc (8)
- # clojure (14)
- # clojure-uk (6)
- # clojurescript (5)
- # conjure (13)
- # crypto (1)
- # data-oriented-programming (1)
- # datalevin (7)
- # emacs (2)
- # fulcro (21)
- # graalvm (14)
- # introduce-yourself (1)
- # lsp (6)
- # malli (17)
- # off-topic (15)
- # re-frame (10)
- # releases (1)
- # sci (2)
- # shadow-cljs (17)
- # tools-build (9)
- # tools-deps (6)
Hi all. Is there a clever way of handling deps.edn git coordinates in tools.build, or is it better to forego git coordinates when building library jars designed to be consumed by the java ecosystem and deploy via maven instead?
In essence, I’m thinking to build a ‘slightly-fat’ jar containing all dependent git coordinate repos but leaving maven dependencies in the pom to be resolved when the library is used.
you should never publish an artifact that includes another lib's source
because you have then hidden the version of that git dep inside your own and any external consumer may make decisions about the same dep without knowing about your choice - you are likely to effectively end up with two versions on the classpath in arbitrary order
but if you wanted to make such a thing but not publish it, you could make the basis, find the deps that are git deps from the basis, copy their source, remove those deps from the basis, then make a jar
Thank you. That is good advice. The context is that I'm quite happy with git coordinates in my clojure based world, but wanted to create a single Java-consumable artefact for a single purpose. I had come to the same conclusion after posting the question, and have removed all my git based coordinates and switched to only using maven based dependencies. That means it is easier to reason about and clojars makes it easy to just use maven. Thank you!
:thumbsup:
As it is, tools.build has made it trivial to handle the housekeeping here so it's all looking good :)