diff --git a/boot/core/src/boot/task/built_in.clj b/boot/core/src/boot/task/built_in.clj index 4dd8b351..180b637e 100644 --- a/boot/core/src/boot/task/built_in.clj +++ b/boot/core/src/boot/task/built_in.clj @@ -291,7 +291,7 @@ (let [tgt (core/tmp-dir!)] (core/with-pre-wrap fileset - (let [tag (or (:tag scm) (util/guard (git/last-commit)) "HEAD") + (let [tag (or (:tag scm) (util/guard (git/last-commit))) scm (when scm (assoc scm :tag tag)) opts (assoc *opts* :scm scm :dependencies (:dependencies (core/get-env)))] (core/empty-dir! tgt) @@ -734,8 +734,10 @@ (format "not a release version (%s)" v)) (assert (or (not ensure-snapshot) snapshot?) (format "not a snapshot version (%s)" v)) - (assert (or (not ensure-tag) (= t ensure-tag)) + (assert (or (not ensure-tag) (not t) (= t ensure-tag)) (format "scm tag in pom doesn't match (%s, %s)" t ensure-tag)) + (when (and ensure-tag (not t)) + (util/warn "The --ensure-tag option was specified but scm info is missing from pom.xml\n")) (assert (or (not ensure-version) (= v ensure-version)) (format "jar version doesn't match project version (%s, %s)" v ensure-version)) (util/info "Deploying %s...\n" (.getName f)) diff --git a/boot/worker/src/boot/jgit.clj b/boot/worker/src/boot/jgit.clj index 2635d3c8..2a3aed84 100644 --- a/boot/worker/src/boot/jgit.clj +++ b/boot/worker/src/boot/jgit.clj @@ -41,9 +41,6 @@ [] (with-repo (->> (jgit/git-log repo) first .getName))) -;;; FIXME: handle case where repo is not at ".", need to add ".." for each -;;; subdirectory level we are below the repo root, so this is broken - (defn ls-files [& {:keys [ref untracked]}] (with-repo diff --git a/boot/worker/src/boot/pom.clj b/boot/worker/src/boot/pom.clj index c6feb6a1..b82d4435 100644 --- a/boot/worker/src/boot/pom.clj +++ b/boot/worker/src/boot/pom.clj @@ -34,8 +34,17 @@ :scm {:url (util/guard (xml1-> z :scm :url text)) :tag (util/guard (xml1-> z :scm :tag text))}})) -(defn pom-xml [{p :project v :version d :description l :license - {su :url st :tag} :scm u :url deps :dependencies :as env}] +(defn pom-xml [{p :project + v :version + d :description + l :license + {su :url + st :tag + sc :connection + sd :developerConnection} :scm + u :url + deps :dependencies + :as env}] (let [[g a] (util/extract-ids p) ls (map (fn [[name url]] {:name name :url url}) l)] (project @@ -55,9 +64,12 @@ (url lu) (name ln) (comments lc)))) - (scm - (url su) - (tag (or st "HEAD"))) + (when (or su st sc sd) + (scm + (when sc (connection sc)) + (when sd (developerConnection sd)) + (when su (url su)) + (when st (tag st)))) (dependencies (for [[p v & {es :exclusions s :scope}] deps :let [[g a] (util/extract-ids p)]]