Add :update support at the top-level of the project map.
This commit is contained in:
parent
65460a35f7
commit
176bcf5e6d
3 changed files with 18 additions and 8 deletions
|
@ -87,9 +87,6 @@
|
||||||
(re-matches re? url))]
|
(re-matches re? url))]
|
||||||
cred)))])))
|
cred)))])))
|
||||||
|
|
||||||
(defn add-auth [repositories]
|
|
||||||
(map add-repo-auth repositories))
|
|
||||||
|
|
||||||
(defn get-proxy-settings
|
(defn get-proxy-settings
|
||||||
"Returns a map of the JVM proxy settings"
|
"Returns a map of the JVM proxy settings"
|
||||||
[]
|
[]
|
||||||
|
@ -104,11 +101,14 @@
|
||||||
:username username
|
:username username
|
||||||
:password password})))
|
:password password})))
|
||||||
|
|
||||||
|
(defn- update-policy [update [repo-name opts]]
|
||||||
|
[repo-name (if update (assoc opts :update update) opts)])
|
||||||
|
|
||||||
(defn- root-cause [e]
|
(defn- root-cause [e]
|
||||||
(last (take-while identity (iterate (memfn getCause) e))))
|
(last (take-while identity (iterate (memfn getCause) e))))
|
||||||
|
|
||||||
(defn- get-dependencies
|
(defn- get-dependencies
|
||||||
[dependencies-key {:keys [repositories local-repo offline?] :as project}
|
[dependencies-key {:keys [repositories local-repo offline? update] :as project}
|
||||||
& {:keys [add-classpath?]}]
|
& {:keys [add-classpath?]}]
|
||||||
{:pre [(every? vector? (project dependencies-key))]}
|
{:pre [(every? vector? (project dependencies-key))]}
|
||||||
(try
|
(try
|
||||||
|
@ -117,7 +117,9 @@
|
||||||
aether/resolve-dependencies)
|
aether/resolve-dependencies)
|
||||||
:local-repo local-repo
|
:local-repo local-repo
|
||||||
:offline? offline?
|
:offline? offline?
|
||||||
:repositories (add-auth repositories)
|
:repositories (->> repositories
|
||||||
|
(map add-repo-auth)
|
||||||
|
(map (partial update-policy update)))
|
||||||
:coordinates (project dependencies-key)
|
:coordinates (project dependencies-key)
|
||||||
:transfer-listener :stdout
|
:transfer-listener :stdout
|
||||||
:proxy (get-proxy-settings))
|
:proxy (get-proxy-settings))
|
||||||
|
|
|
@ -87,5 +87,6 @@
|
||||||
(is (= [["sonatype" {:url "https://oss.sonatype.org/"}]
|
(is (= [["sonatype" {:url "https://oss.sonatype.org/"}]
|
||||||
["internal" {:password "reindur" :username "milgrim"
|
["internal" {:password "reindur" :username "milgrim"
|
||||||
:url "https://sekrit.info/repo"}]]
|
:url "https://sekrit.info/repo"}]]
|
||||||
(add-auth [["sonatype" {:url "https://oss.sonatype.org/"}]
|
(map add-repo-auth
|
||||||
["internal" {:url "https://sekrit.info/repo"}]])))))
|
[["sonatype" {:url "https://oss.sonatype.org/"}]
|
||||||
|
["internal" {:url "https://sekrit.info/repo"}]])))))
|
||||||
|
|
|
@ -127,7 +127,10 @@
|
||||||
;; You can also set the policies for how to handle :checksum
|
;; You can also set the policies for how to handle :checksum
|
||||||
;; failures to :fail, :warn, or :ignore. In :releases, :daily,
|
;; failures to :fail, :warn, or :ignore. In :releases, :daily,
|
||||||
;; :always, and :never are supported.
|
;; :always, and :never are supported.
|
||||||
:releases {:checksum :fail :update :always}}
|
:releases {:checksum :fail :update :always}
|
||||||
|
;; You can set :checksum and :update here for them
|
||||||
|
;; to apply to both :releases and :snapshots:
|
||||||
|
:update :always, :checksum :fail}
|
||||||
;; Repositories named "snapshots" and "releases" automatically
|
;; Repositories named "snapshots" and "releases" automatically
|
||||||
;; have their :snapshots and :releases disabled as appropriate.
|
;; have their :snapshots and :releases disabled as appropriate.
|
||||||
;; Credentials for repositories should *not* be stored
|
;; Credentials for repositories should *not* be stored
|
||||||
|
@ -137,6 +140,10 @@
|
||||||
;; :password "locative.1"}}}}
|
;; :password "locative.1"}}}}
|
||||||
"snapshots" "http://blueant.com/archiva/snapshots"
|
"snapshots" "http://blueant.com/archiva/snapshots"
|
||||||
"releases" "http://blueant.com/archiva/internal"}
|
"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
|
||||||
|
;; directly but apply the "update" profile instead.
|
||||||
|
:update :always
|
||||||
;; the deploy task will give preference to repositories specified in
|
;; the deploy task will give preference to repositories specified in
|
||||||
;; :deploy-repositories, and repos listed there will not be used for
|
;; :deploy-repositories, and repos listed there will not be used for
|
||||||
;; dependency resolution.
|
;; dependency resolution.
|
||||||
|
|
Loading…
Reference in a new issue