deps.edn :paths for mixed project?

50 views
Skip to first unread message

dimitris

unread,
Apr 22, 2018, 8:28:28 AM4/22/18
to Clojure
Hi all,

I must be missing something big, as I seem unable to use deps.edn and
the new `clj` CLI tool in a mixed clojure/java project. Suppose i have
the following dummy directory structure:

- src

--clojure (source-path)

--- FOO (package)

---- (FOO.ns1.clj)

---- (FOO.ns2.clj)

---- etc

-- java (soure-path)

--- BAR (package)

---- BAR.xxx.java

---- BAR.yyy.java

---- etc


In leiningen i can simply specify :source-paths [ "src/clojure"], &
:java-source-paths ["src/java"] and everything works as expected. What
am I expected to do to achieve the same thing with deps.edn? I tried
putting both of those under `:paths` but that didn't work
(java.lang.ClassNotFoundException) when trying to test (clj -Atest).

Kind regards,

Dimitris


Alex Miller

unread,
Apr 22, 2018, 9:15:08 AM4/22/18
to Clojure
clj is not a build tool, only a pure Clojure runner, so without something additional to do Java compilation, you can’t use it in a mixed source project.

If you did use a build tool to compile the Java source to classes, you could include the output classes directory for the Java code on your deps.edn paths to use clj.
Reply all
Reply to author
Forward
0 new messages