重现情况
(! 748)-> cat deps.edn
{:deps {org.clojure/data.csv {:mvn/version "RELEASE"}}}
(! 749)-> cat src/foo.clj
(ns foo
"Example namespace."
(:require [clojure.data.csv :as csv]))
(defn bar "Example function" [_] (println "Baaa!"))
(! 750)-> clojure -X foo/bar
Baaa!
(! 751)-> clojure -X:deps help/doc :fn foo/bar
Syntax error (FileNotFoundException) compiling at (foo.clj:1:1).
Could not locate clojure/data/csv__init.class, clojure/data/csv.clj or clojure/data/csv.cljc on classpath.
Full report at:
/var/folders/p1/30gnjddx6p193frh670pl8nh0000gn/T/clojure-12591734153756667401.edn
因为 -X:deps
替换了项目依赖,所以只找到了 src
文件(因为 :paths
未被替换)。