Don't invoke release plugin fallback unless external plugin is present.

The existing fallback logic assumes that the presence of two release
tasks on the classpath can only be due to one of them coming from a
plugin, but this is not true; you can have an uberjar of Leiningen
building Leiningen itself.

Fixes #2198
This commit is contained in:
Phil Hagelberg 2017-03-23 14:13:01 -07:00
parent 77ad686ff8
commit 3ac76a3ccd

View file

@ -138,5 +138,7 @@ bump. If none is given, it defaults to :patch."
(when-let [[resource] (-> (.getContextClassLoader (Thread/currentThread))
(.getResources "leiningen/release.clj")
(enumeration-seq) (distinct) (rest) (seq))]
(clojure.lang.Compiler/load (io/reader resource)
"leiningen/release.clj" (str resource)))
(let [release-str (str resource)]
(when-not (re-find #"support existing release plugin" release-str)
(clojure.lang.Compiler/load (io/reader resource)
"leiningen/release.clj" release-str))))