Showing posts with label Leiningen. Show all posts
Showing posts with label Leiningen. Show all posts

Sunday, 12 August 2012

Using Java github repo's from Clojure

This week after watching Mike's lightning talk on bloom & count-min sketch algorithms I found myself hacking away at a Clojure implementation of a bloom filter and needing to pull in a Java project from github (a murmur hash implementation).



Here's how it's done:
  1. Add the following line to ~/.lein/profiles: [lein-git-deps "0.0.1-SNAPSHOT"] under :user :plugins, like so:
  2. Form the command line run: lein deps

  3. In your projects project.clj file add the following: where :git-dependencies is the github url of the repo you wish to use and :java-source-paths is the path where Leiningen will find the source code to build (note: it will be downloaded from github into a directory .lein-git-deps/ by default
  4. From the command like run: lein git-deps

  5. Add an import statement to your clojure files: