Added documentation about :exclusions in :dependencies to the README and deps docstring.

This commit is contained in:
Matt Revelle 2009-12-21 16:19:31 -05:00
parent f05055f634
commit 3360ad4e0b
2 changed files with 21 additions and 2 deletions

View file

@ -112,6 +112,16 @@ Other keys accepted:
Alternatively you can install into your local repository in ~/.m2 Alternatively you can install into your local repository in ~/.m2
with Maven for Java libs or "lein install" for Clojure libs. with Maven for Java libs or "lein install" for Clojure libs.
**Q:** Is it possible to exclude indirect dependencies?
**A:** Yes. Some libraries, such as log4j, depend on projects that are
not included in public repositories and unnecessary for basic
functionality. Projects listed as :dependencies may exclude
any of their dependencies by using the :exclusions key, as demonstrated here:
\[log4j "1.2.15" :exclusions \[javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
com.sun.jmx/jmxri\]\]
**Q:** How should I pick my version numbers? **Q:** How should I pick my version numbers?
**A:** Use [semantic versioning](http://semver.org). **A:** Use [semantic versioning](http://semver.org).

View file

@ -30,10 +30,19 @@
(defn deps (defn deps
"Download and install all :dependencies listed in project.clj into the lib/ "Download and install all :dependencies listed in project.clj into the lib/
directory. With an argument it will skip develpment dependencies. Dependencies directory. With an argument it will skip development dependencies. Dependencies
should be a vector of entries specifying group, name, and version like the should be a vector of entries specifying group, name, and version like the
following: following:
[org.clojure/clojure-contrib \"1.0-SNAPSHOT\"]" [org.clojure/clojure-contrib \"1.0-SNAPSHOT\"]
It is also possible to exclude specific indirect dependencies of a direct
dependency using the optional :exclusions keyword and vector of entries.
A project that depends on log4j could exclude unnecessary indirect
dependencies with the following:
[log4j \"1.2.15\" :exclusions [javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
com.sun.jmx/jmxri]]"
([project skip-dev] ([project skip-dev]
(let [deps-task (DependenciesTask.)] (let [deps-task (DependenciesTask.)]
(.setBasedir lancet/ant-project (:root project)) (.setBasedir lancet/ant-project (:root project))