project.clj does not know where to look for foo / defproject. So, if you are on a replica, you can do
user> (in-ns 'foo) foo> (read-project "project.clj")
This will run the code from project.clj inside the foo namespace, where defproject is defined. Or you can place (in-ns' foo) inside project.clj. The result will be the same.
But you can also write something like this in project.clj:
(foo/defproject ...)
This will call defproject inside your current namespace at startup (foo / read-project "project.clj").
Update
from test_uberjar.clj:
(def project (binding [*ns* (the-ns 'leiningen.core)] (read-project "test_projects/sample_no_aot/project.clj")))
from test_deps.clj:
(:use [leiningen.core :only [read-project defproject]] ...)
Thus, defproject is always available when loading a file.
koddo source share