I wanted to experiment with building a webapp using Clojure, so I tried setting up the Compojure web framework. I am new to clojure, so I am not sure if this is the preferred way of doing things, but here goes anyway.

There seem to be several ways to set up clojure in emacs. I ended up following Bill Clementson's instructions. A couple of years ago I had some experience using maven, so decided to use this to manage my classpath. Installing maven on my mac was simple with macports (sudo port install maven).

Setting up a POM for maven took longer than expected. Stuart Sierra's post pointed me to the formos maven repository containing the clojure snapshots. With some help from google, I also found the maven-clojure-plugin, which is a maven plugin for compiling clojure, and the clojureshell-maven-plugin which will start a swank session (or bare REPL) using the pom information.

With the basic clojure and maven setup in place, it was time to move on to compojure. I added the Compojure git repository into Bill Clementson's clj-build script, ran it to clone the repository, and then built it using ant (ant deps; ant). Jim Downing instructions for installing compojure into your local maven repository (mvn install:install-file -DgroupId=org.clojure -DartifactId=compojure -Dversion=1.0-SNAPSHOT -Dfile=compojure.jar -Dpackaging=jar) work smoothly.


Comments

By Timothy Pratley, 4 December 2009, 18:27

Would you mind posting your final pom.xml?


Thanks for taking the time to contribute.

All comments are moderated and I reserve the right to remove comments for any reason, including abusiveness, illegality, and spam links.

Comments are plain text, with blank lines seperating paragraphs. Anything that looks like a URI will become a link. Any HTML will be escaped and appear as you type it in.

(optional, will not be published)
(used to link your comment back to you)

Setting up clojure and compojure with maven
Written: 6-9-2009
Tags: