Welcome! Please see the About page for a little more info on how this works.

0 votes
in Docs by

Hi all
I am afraid there is a typo in https://clojure.org/guides/tools_build

In the Compiled uberjar application build section the build.clj should read

...

(b/uber {:class-dir class-dir

       :uber-file uber-file
       :basis basis
       :main 'my.lib.main}))

currently reads :main my.lib.main (no apostrophe there)

This may be evident for experienced guys but it is a problem for beginners like me

Thanks!

1 Answer

0 votes
by

Given that the main ns is specific to the project, I wonder if it would be better to have:

(def main-ns 'my.lib.main)

at the top (after lib, say) and then use that var in the call to uber?

(b/uber {:class-dir class-dir
         :uber-file uber-file
         :basis     basis
         :main      main-ns})

Then it might be worth showing an alternative call to compile-clj that just compiles that main ns instead of implicitly compiling "all" -- and show that :src-dirs can be [] when :ns-compile [main-ns] is provided?

...