interstar interstar - 7 months ago 39
Java Question

Can Leiningen install (and let my Clojure project use) Java packages directly from Maven?

I'm not used to the Java / Maven ecosystem, but I'm happy using the Clojure / Leiningen / Clojars one.

So can I simply put the name of a package from in my project.clj file, the way I'd put a clojar reference? Or is there more to it?


The short answer - yes.

Read about Maven coordinates to understand terminology - artifacts, groups and versions. It is common with Leiningen - see here.

And yes, you just put package coordinates from Maven to project.clj and off you go. The translation is trivial. If you have for example


then in project.clj it will look like

:dependencies [[log4j/log4j "1.2.17"]]