(defn make-dependency
"Makes a dependency from a seq. The seq (usually a vector) should contain a symbol to define the
group and artifact id, then a version string. The remaining arguments are combined into a map. The value
for the :classifier key (if present) is the classifier on the dependency (as a string). The value for
the :exclusions key, if present, is a seq of symbols, identifying group ids and artifact ids to exclude
from transitive dependencies."
[[dep version & extras]]
(let [extras-map (apply hash-map extras)
exclusions (:exclusions extras-map)
classifier (:classifier extras-map)
es (map make-exclusion exclusions)]
(doto (Dependency.)
;; Allow org.clojure group to be omitted from clojure/contrib deps.
(.setGroupId (if (and (nil? (namespace dep))
(re-find #"^clojure(-contrib)?$" (name dep)))
"org.clojure"
(or (namespace dep) (name dep))))
(.setArtifactId (name dep))
(.setVersion version)
(.setClassifier classifier)
(.setExclusions es))))
Used in 0 other vars
Comments top
No comments for make-dependency. Log in to add a comment.