clojure

richiardiandrea 2025-08-14T16:26:09.804109Z

dear all - hope everybody is good - I have a question here... when I build a library jar that pulls another lib by :git/sha I can't seem to see that lib written in the META-INF/maven/...pom.xml is that supported?

dpsutton 2025-08-14T16:26:41.587729Z

it cannot be

dpsutton 2025-08-14T16:26:52.185369Z

poms can’t reference git coordinates

richiardiandrea 2025-08-14T16:27:05.228339Z

hmm, right, didn't think about that

richiardiandrea 2025-08-14T16:27:46.530609Z

so is the only way to publish the library and use the standard :mvn/version

dpsutton 2025-08-14T16:28:25.828539Z

a jar must declare its dependencies in a way that the jar ecosystem can locate and download them. git resolution is a trick that clojure has but not jars in general

👍 1
dpsutton 2025-08-14T16:28:44.586949Z

i’m being a bit cagey because you can “publish” your library by just pushing to github

richiardiandrea 2025-08-14T16:29:36.796489Z

yeah so I meant publish to artifactory/maven

richiardiandrea 2025-08-14T16:29:56.645029Z

I guess that's what I am going to have to do

p-himik 2025-08-14T16:30:20.310669Z

Depending on some specifics of of that dependency (most notably, its license), a possible alternative is to vendor it into your library. Just make sure the packages and any possible global identifiers are changed so that there are no conflicts of anyone else depend on both your library and that other library.

richiardiandrea 2025-08-14T16:31:47.483689Z

I guess I could also add the dep as top level in the parent parent project

p-himik 2025-08-14T16:32:09.426559Z

For example, re-frame-10x uses https://github.com/benedekfazekas/mranderson. Because it needs a specific version of Reagent and other things, and it can't just include them as regular dependencies to avoid any conflicts with the main app.

dpsutton 2025-08-14T16:32:20.108419Z

you can vendor it, but you also risk having duplicates on the classpath in this way unless you do some shadowing

👍 1
dpsutton 2025-08-14T16:32:37.268299Z

(ah, right. as mentioned. sorry for duplicate)

p-himik 2025-08-14T16:32:54.629239Z

:D A duplicate about avoiding duplicates.

dpsutton 2025-08-14T16:33:10.746549Z

really reinforces the issue 🙂

richiardiandrea 2025-08-14T16:33:21.400659Z

thanks both I think that's gives me my answer 🙂

dpsutton 2025-08-14T16:34:37.594219Z

i’d probably write a script to manually vendor something. I think there’s some prior art in clojure itself in how it gets the asm library. If your library isn’t complicated it might be easier to copy it into a separate classpath root and update namespaces names so it has a new part and use that

richiardiandrea 2025-08-14T16:35:02.210169Z

I think the easiest here for me is to publish 😉

dpsutton 2025-08-14T16:35:10.494829Z

ah. yes if you control the lib lol

richiardiandrea 2025-08-14T17:39:47.115879Z

apparently deploying internally here will require some time - @p-himik do you know if there exists a mranderson for deps.edn or something similar to that?

p-himik 2025-08-14T17:43:13.271409Z

No clue, sorry.

🙏 1
dpsutton 2025-08-14T17:43:55.927489Z

how many namespaces and deps are in the git/sha thing?

richiardiandrea 2025-08-14T17:44:18.119659Z

not many yeah