1.2.0 permalink Arrow_down_16x16

make-dependency

leiningen.pom

  • (make-dependency [dep version & extras])
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.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source leiningen/pom.clj:78 top

(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))))
Vars in leiningen.pom/make-dependency: and defn doto let name namespace nil? or re-find
Used in 0 other vars

Comments top

No comments for make-dependency. Log in to add a comment.