我正在使用tools.namespace來爲REPL上的名稱空間提供智能重新加載。但是,當致電refresh
或refresh-all
時,會引發錯誤。clojure.tools /名稱空間刷新失敗,並顯示「No namespace:foo」
user=> (require '[clojure.tools.namespace.repl :as tn])
user=> (tn/refresh)
:reloading (ep31.common ep31.routes ep31.config ep31.application user ep31.common-test ep31.example-test)
:error-while-loading user
java.lang.Exception: No namespace: ep31.config, compiling:(user.clj:1:1)
而且似乎在(require ep31.config)
作品沒有錯誤,但事後命名空間不能實際上說明這個奇怪的狀態結束。
這是正確的。 Leiningen默認將'target/classes'放在類路徑上,原因有兩個:1)爲已編譯的Java源提供應用程序,2)AOT編譯的輸出目錄('* compile-path *')必須爲on類路徑。 –
因此,如果你在做'lein uberjar'之後做了'lein clean',你不會遇到你的問題嗎?或者,只要你進入一個糟糕的狀態,就像你在問題中所描述的那樣,「乾淨」。 –