When I deploy to clojars, should org.clojure/clojure be added or be removed in :dependencies in project.clj?
- In following tutorial, org.clojure/clojure is added in :dependencies in project.clj. https://github.com/clojars/clojars-web/wiki/Tutorial
- project.clj in some famous library such as clj-http does not include org.clojure/clojure as dependencies. https://clojars.org/clj-http
- project.clj in other famous library such as ring/ring-core includes org.clojure/clojure as dependencies. https://clojars.org/ring/ring-core
Which is better way?
When you deploy a library to Clojars, you will be deploying a JAR file containing just the source of your own project, in general. The JAR file will not contain any of the dependencies in your project. Those will be specified in a
pom.xml
file that is also deployed to Clojars. Thatpom.xml
file is auto-generated by Leiningen when it builds and deploys your JAR file to Clojars.When other projects depend on your library, they will get the code from the JAR file and the accompanying
pom.xml
will tell them what other libraries are needed to use your code. Leiningen automatically downloads those other libraries, once it has downloaded your library from Clojars.Since all such projects are going to require Clojure itself to run them, they will already have a dependency on Clojure -- so it won't matter whether your project indicates a dependency on Clojure or not.