What does :scope "test" mean in build.boot dependency?

Viewed 389

A lot of examples have dependencies written like

[org.clojure/tools.nrepl "0.2.12" :scope "test"]

I think it means to not include this dependency in prod build, like lein's dev profile, but I can't find any documentation on this. What other scopes are available? Do they have hardcoded meaning within boot or is it something a user can define?

1 Answers

This translates directly to Maven scopes.

For test:

This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. This scope is not transitive.

In boot these dependencies are excluded when you build a jar artifact. Also they do not count as transitive dependencies when you have a dependency on the project. This is also used to specify the Clojure version in a boot project:

Libraries (including Boot tasks) shouldn't depend directly on a Clojure version. Instead, they should use :scope "provided" qualifier with a Clojure dependency. This qualifier makes the dependency non-transitive. Then the dependency works as a documentation about required Clojure version.

Source

Related