Tip: Clojure REPL from mvn

March 11, 2009

If you manage your dependencies using maven, you can get clojure by including it as a dependency. You can pick this up from the formos repository at http://tapestry.formos.com/maven-snapshot-repository/org/clojure/, or keep a local source copy of clojure and install locally.

Make sure your pom has a build section that points to your clojure code in a scriptSourceDirectory element (and?) or in a resource element. You can then start a Repl with your dependencies on the classpath by running

mvn exec:java -Dexec.mainClass=clojure.lang.Repl

For extra credit, include jline:jline as an optional dependency in your pom and change your execution line to: –

mvn exec:java -Dexec.mainClass=jline.ConsoleRunner -Dexec.args="clojure.lang.Repl"

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: