Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add global :exclusions

  • Loading branch information...
commit ac9f135c89caf03229fec0e3d8ee6cff66df61f8 1 parent 90aad00
@joegallo joegallo authored
View
4 sample.project.clj
@@ -40,6 +40,10 @@
;; development. Projects that depend on this project will not pull
;; in its dev-dependencies, and they won't be included in the uberjar.
:dev-dependencies [[org.clojure/swank-clojure "1.2.1"]]
+ ;; Global exclusions are applied across the board, as an alternative
+ ;; to duplication for multiple depedencies with the same excluded libraries.
+ :exclusions [org.apache.poi/poi
+ org.apache.poi/poi-ooxml]
;; Only re-fetch dependencies when they change in project.clj or
;; when :library-path directory is empty.
:checksum-deps true
View
2  src/leiningen/deps.clj
@@ -78,7 +78,7 @@
(doseq [repo (make-repositories project)]
(.addConfiguredRemoteRepository deps-task repo))
(doseq [dep (project deps-set)]
- (.addDependency deps-task (make-dependency dep)))
+ (.addDependency deps-task (make-dependency project dep)))
deps-task))
(defn use-dev-deps? [project skip-dev]
View
43 src/leiningen/util/maven.clj
@@ -145,26 +145,29 @@ 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."
- [dependency]
- (when-not (vector? dependency)
- (abort "Dependencies must be specified as vector:" dependency))
- (let [[dep version & extras] dependency
- extras-map (apply hash-map extras)
- exclusions (:exclusions extras-map)
- classifier (:classifier extras-map)
- type (:type 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)
- (.setType (or type "jar"))
- (.setExclusions es))))
+ ([dependency]
+ (make-dependency {} dependency))
+ ([project dependency]
+ (when-not (vector? dependency)
+ (abort "Dependencies must be specified as vector:" dependency))
+ (let [[dep version & extras] dependency
+ extras-map (apply hash-map extras)
+ exclusions (:exclusions extras-map)
+ classifier (:classifier extras-map)
+ type (:type extras-map)
+ es (map make-exclusion (concat exclusions
+ (:exclusions project)))]
+ (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)
+ (.setType (or type "jar"))
+ (.setExclusions es)))))
(defn make-repository [[id settings]]
(let [repo (Repository.)]
Please sign in to comment.
Something went wrong with that request. Please try again.