7

I want to download and install this Clojure library but cannot for the life of me figure it out. I researched Maven, but couldn't get it to find the repo. How can I easily install a Clojure library onto my machine?

3 Answers 3

8

You could add the repository containing this jar to your pom or settings file and specify the relevant jar as a dependency.

<repository>
  <id>clojars.org</id>
  <url>http://clojars.org/repo</url>
</repository>
...
<dependency>
   <groupId>clj-http</groupId>
   <artifactId>clj-http</artifactId>
   <version>0.4.1</version>
</dependency>
2
  • 2
    <repositoriry> tag should be wrapped with <repositories> tag and then solution works great :)
    – gadon
    Sep 22, 2014 at 21:56
  • The accepted answer is more to the point of just downloading the JAR. This answer presumes the existence of a POM.
    – opyate
    Jun 23, 2018 at 21:48
6

download https://clojars.org/repo/clj-http/clj-http/0.4.1/clj-http-0.4.1.jar

mvn install:install-file -DgroupId=clj-http -DartifactId=clj-http -Dversion=0.4.1 -Dpackaging=jar -Dfile=clj-http-0.4.1.jar
2
0

If you are using Leiningen you can just read all about how to connect to repository server on a recent Sonatype blog post from Tim O'Brien.

If you are using Maven you should get a repo server like Nexus and setup the clojure repo as another proxy repository and add it to your public group.

If neither of these approaches is ok with you you can use Raghurams approach or number23_cn. Both of them however are semi optimal and will not scale for teams or many artifacts..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.