views:

460

answers:

2

It seems Leiningen's compile task looks for source packages to start immediately under the /src directory. I use both Java and Clojure in my project, so my /src directory looks like this:

/src/java/myapp
/src/clojure/myapp

Right now Leiningen is looking for /src/myapp and it's failing out during the compile.

Related, I'd like to know how to manually add directories to the classpath for Leiningen's compile and repl tasks. For example, Enlive's deftemplate function will search the classpath for a named template file. Adding /templates to the classpath would be required for my project to build and run properly.

A: 

Have you tried setting the :root value in your project file?

Looking at the source code for the compile command, it will process only Clojure files anyway and will look for these files under (file (:root project) "src") , so you could set :root to point to "src/clojure/" but would still need a symlink so that "src/clojure/src/" exists...

HD
This didn't immediately work, though I didn't play with it too much
rcampbell
+2  A: 

This will be fixed in Leiningen 1.0 which is currently looking good for a release in the next week or so. Hopefully someone writes a javac plugin for Leiningen too; it should be easy to write as Lein bundles ant so you could just reuse ant's javac task.

Alex Osborne