diff --git a/leiningen-core/src/leiningen/core/classpath.clj b/leiningen-core/src/leiningen/core/classpath.clj index 2e45b52d8..fd00bc4b5 100644 --- a/leiningen-core/src/leiningen/core/classpath.clj +++ b/leiningen-core/src/leiningen/core/classpath.clj @@ -53,6 +53,10 @@ "Call f with args when keys in project.clj have changed since the last run. Stores value of project keys in stale directory inside :target-path." [keys project f & args] + (prn :target-path (:target-path project)) + (when-not (:target-path project) + (prn :no-target project) + (throw (Exception. "No target path!"))) (let [file (io/file (:target-path project) "stale" (str/join "+" (map name keys))) current-value (pr-str (map (juxt identity project) keys)) @@ -101,14 +105,17 @@ :username username :password password}))) -(defn- update-policy [update [repo-name opts]] - [repo-name (if update (assoc opts :update update) opts)]) +(defn- update-policies [update checksum [repo-name opts]] + (let [opts (if update (assoc opts :update update) opts) + opts (if checksum (assoc opts :checksum checksum) opts)] + [repo-name opts])) (defn- root-cause [e] (last (take-while identity (iterate (memfn getCause) e)))) (defn- get-dependencies - [dependencies-key {:keys [repositories local-repo offline? update] :as project} + [dependencies-key {:keys [repositories local-repo offline? update checksum] + :as project} & {:keys [add-classpath?]}] {:pre [(every? vector? (project dependencies-key))]} (try @@ -119,7 +126,7 @@ :offline? offline? :repositories (->> repositories (map add-repo-auth) - (map (partial update-policy update))) + (map (partial update-policies update checksum))) :coordinates (project dependencies-key) :transfer-listener :stdout :proxy (get-proxy-settings)) diff --git a/sample.project.clj b/sample.project.clj index 8a8460d7a..ea83b6840 100644 --- a/sample.project.clj +++ b/sample.project.clj @@ -141,7 +141,7 @@ "snapshots" "http://blueant.com/archiva/snapshots" "releases" "http://blueant.com/archiva/internal"} ;; You can set :update and :checksum policies here to have them - ;; apply for all :repositories. Usually you will not set this + ;; apply for all :repositories. Usually you will not set :update ;; directly but apply the "update" profile instead. :update :always ;; the deploy task will give preference to repositories specified in diff --git a/todo.org b/todo.org index a968e6b9c..439501511 100644 --- a/todo.org +++ b/todo.org @@ -8,7 +8,7 @@ See also https://github.com/technomancy/leiningen/issues - [X] Make offline profile use dev profile (#514) (LHF) - [X] Fix $JVM_OPTS (#565) - [X] Move lein-newnew plugin into default profile (#540) - - [ ] Force checking of snapshots (#518) (LHF) + - [X] Force checking of snapshots (#518) (LHF) ** Intermediate - [X] Pretty-print pom - [X] deps :tree