technomancy/leiningen — Issue #342: lein install fails if :java-source-path is "src"
Author: daveray
Created: 2011-12-01 02:24:10+00:00
State: open

A recent change (098acdf93e765cd6f1eece75e98b854fdbf5e90c) includes Java source files in the generated jar. If `:java-source-path` is the same as `:source-path`, e.g. "src", this causes duplicate entries in the filespecs for all the Clojure code, which leads to duplicate entry exceptions (see below). So, I guess the question is: is mixing Java and Clojure source bad? If so, a warning should be printed if they're in the same directory. Otherwise, the filespec list should be filtered for duplicates I think.

[540,0] seesaw [develop]$ lein install
Compiling 1 source file to /Users/dave/Documents/projects/seesaw/classes
No namespaces to :aot compile listed in project.clj.
Exception in thread "main" java.util.zip.ZipException: duplicate entry: seesaw/action.clj (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at clojure.lang.Var.invoke(Var.java:377)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: java.util.zip.ZipException: duplicate entry: seesaw/action.clj
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:90)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
at leiningen.jar$fn__3686.invoke(jar.clj:127)
at clojure.lang.MultiFn.invoke(MultiFn.java:172)
at leiningen.jar$write_jar.invoke(jar.clj:142)
at leiningen.jar$jar.invoke(jar.clj:210)
at leiningen.jar$jar.invoke(jar.clj:214)
at leiningen.install$install.invoke(install.clj:49)
at clojure.lang.Var.invoke(Var.java:365)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$apply_task.invoke(core.clj:259)
at leiningen.core$_main.doInvoke(core.clj:325)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:328)
at user$eval42.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 11 more