From 1a0680ee822c3b75aaf371a563da4ce285ea13f5 Mon Sep 17 00:00:00 2001 From: Marcus Crestani Date: Tue, 17 Mar 2015 15:27:11 +0100 Subject: [PATCH] Pass main to uberjar to enable building binaries for profiles that override the main class. --- src/leiningen/bin.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/leiningen/bin.clj b/src/leiningen/bin.clj index 93faf09..cb6e806 100644 --- a/src/leiningen/bin.clj +++ b/src/leiningen/bin.clj @@ -42,13 +42,13 @@ Add :main to your project.clj to specify the namespace that contains your -main function." [project] - (if (:main project) + (if-let [main (:main project)] (let [opts (jvm-options project) target (fs/file (:target-path project)) binfile (fs/file target (or (get-in project [:bin :name]) (str (:name project) "-" (:version project)))) - jarfile (uberjar project)] + jarfile (uberjar project main)] (println "Creating standalone executable:" (str binfile)) (io/make-parents binfile) (with-open [bin (FileOutputStream. binfile)]