From bf14d0321cb26b9d439f9300318be1837227bb7a Mon Sep 17 00:00:00 2001 From: Paula Gearon Date: Tue, 23 Feb 2021 17:05:17 -0500 Subject: [PATCH] Removing CLASSPATH from the environment when launching lein in a shell subprocess --- src/leiningen/modules.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/leiningen/modules.clj b/src/leiningen/modules.clj index b654751..ad9c7ca 100644 --- a/src/leiningen/modules.clj +++ b/src/leiningen/modules.clj @@ -191,7 +191,8 @@ Accepts '-q', '--quiet' and ':quiet' to suppress non-subprocess output." (println " Building" (:name project) (:version project) (dump-profiles args)) (println "------------------------------------------------------------------------")) (if-let [cmd (get-in project [:modules :subprocess] subprocess)] - (binding [eval/*dir* (:root project)] + (binding [eval/*dir* (:root project) + eval/*env* (with-meta (dissoc (into {} (System/getenv)) "CLASSPATH") {:replace true})] (let [exit-code (apply eval/sh (cons cmd args))] (when (pos? exit-code) (throw (ex-info "Subprocess failed" {:exit-code exit-code})))))