Skip to content

Commit 4993ecc

Browse files
committed
add section to tdeps guide on dep list/tree
1 parent 7fd2837 commit 4993ecc

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

content/guides/deps_and_cli.adoc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,37 @@ user=> (+ 1 1)
509509

510510
Use Ctrl-D to exit the repl and Ctrl-C to exit the server.
511511

512+
[[list_deps]]
513+
=== List all dependencies
514+
515+
There are several helpful tools in the built-in `:deps` alias to explore the full set of transitive deps.
516+
517+
To https://clojure.github.io/tools.deps.cli/clojure.tools.deps.cli.api-api.html#clojure.tools.deps.cli.api/list[list the full set of all the deps] included on your classapth, use `clj -X:deps list`. For example in the `hello-world` application at the top of this guide, you would see something like this:
518+
519+
[source,shell]
520+
----
521+
% clj -X:deps list
522+
clojure.java-time/clojure.java-time 1.1.0 (MIT)
523+
org.clojure/clojure 1.11.1 (EPL-1.0)
524+
org.clojure/core.specs.alpha 0.2.62 (EPL-1.0)
525+
org.clojure/spec.alpha 0.3.218 (EPL-1.0)
526+
time-lib/time-lib ../cli-getting-started/time-lib
527+
----
528+
529+
The full set of transitive dependencies used by your application is listed in alphabetical order with version and license. See the api docs for additional printing options.
530+
531+
If you want to understand the https://clojure.github.io/tools.deps.cli/clojure.tools.deps.cli.api-api.html#clojure.tools.deps.cli.api/tree[tree structure of your dependencies] and how version selection choices were made, use `clj -X:deps tree`:
532+
533+
[source,shell]
534+
----
535+
% clj -X:deps tree
536+
org.clojure/clojure 1.11.1
537+
. org.clojure/spec.alpha 0.3.218
538+
. org.clojure/core.specs.alpha 0.2.62
539+
time-lib/time-lib /Users/alex.miller/tmp/cli-getting-started/time-lib
540+
. clojure.java-time/clojure.java-time 1.1.0
541+
----
542+
543+
There were no version selections made here, but see https://clojure.org/reference/dep_expansion#_tree_printing[the docs] for more on how the choices are explained in the tree.
544+
545+
Both of these helper functions take an optional `:aliases` argument if you wish to examine the dependency list or tree with one or more aliases applied, such as `clj -X:deps list '[:alias1 :alias2]'`.

0 commit comments

Comments
 (0)