anchor.diff:    "clojars" {:url "https://clojars.org/repo"}}}
   ----
   
  -=== Modifying the default repositories
  -
  -The `:mvn/repos` map is `merge-with` `merge` across the deps.edn sources, so you can modify the default repositories by specifying a new definition or remove it by specifying `nil`.
  -
  -tools.deps guarantees that the `"central"` and `"clojars"` repositories will be checked first for Maven libraries.
  -
  -=== Maven authenticated repos
  +==== Maven authenticated repos
   
   For Maven deps in authenticated repositories, existing Maven infrastructure is used to convey credentials.
   
  
positive.code: 
  Clojure build tools have traditionally taken the approach of wrapping the Maven ecosystem to gain access to Java libraries. However, they have also forced this approach on Clojure code as well, requiring a focus on artifacts that must be built and deployed (which Clojure does not require). This approach has created friction for Clojure developers, making it hard to e.g. work with libs not yet publishing artifacts, work on speculative changes w/o artifacts or across multiple libs, or give control to a 3rd party to manage shared dependencies.
  
  To this end Clojure provides:
  
  * https://github.com/clojure/tools.deps.alpha[tools.deps.alpha] - a library providing an API for resolving dependency graphs and building classpaths that can utilize both Maven and other providers of code or artifacts
  * Command line tools (`clojure` and `clj`) that enable users to make use of this capability at the terminal to declare dependencies, assemble classpaths, and launch Clojure programs with data
  * System-specific installers for downloading the tools, improving the "Getting Started" experience
  
  = Overview
  
  You use the Clojure tools (`clj` or `clojure`) to run Clojure programs on the JVM, e.g. to start a REPL or invoke a specific function with data. The Clojure tools will configure the JVM process by defining a classpath (of desired libraries), an execution environment (JVM options) and specifying a main class and args.
  
  Using a deps.edn file (or files), you tell Clojure where your source code resides and what libraries you need. Clojure will then calculate the full set of required libraries and a classpath, caching expensive parts of this process for better performance.
  
  The internal steps of the Clojure tools, as well as the Clojure functions you intend to run, are parameterized by data structures, often maps. Shell command lines are not optimized for passing nested data, so instead you will put the data structures in your deps.edn file and refer to them on the command line via _aliases_ - keywords that name data structures.
  
  `clj` and `clojure` differ in that `clj` has extra support for use as a REPL in a terminal, and should be preferred unless you don't want that support, then use `clojure`. The invocation structure is the same for both:
  
  [source]
  ----
  clj [clj-opt*] [execution-specifier]
  ----
  
  == Starting a REPL
  
  To run a REPL, just do not supply any execution-specifier:
  
  [source]
  ----
  $ clj
  Clojure 1.10.1
  user=>
  ----
  
  == Executing a function that takes a map
  
  _Available in clj 1.10.1.619 or higher, currently a release candidate_
  
  If you have a function invocation you will frequently repeat, you can put a descriptor for it under a `deps.edn` alias and execute it with `-X`:
  
  [source]
  ----
  clojure [clj-opt*] -X:an-alias [kpath v]*
  ----
  
  `-X` is configured with a descriptor map with `:fn` and `:args` keys, and stored under an alias in `deps.edn`:
  
  [source,clojure]
  ----
  {:aliases
   {:my-fn
    {:fn my.qualified/fn
     :args {:my {:data 123}
            :config 456}}}}
  ----
  
  To invoke, pass the name of the alias:
  
  [source]
  ----
  clj -X:my-fn
  ----
  
  You can supply additional keys, or override values stored in the deps.edn file by passing pairs of key-path and value. The key-path should either be a single key or a vector of keys to refer to a nested key (as with `assoc-in`). Each key-path will be used to `assoc-in` to the original `:args` map, overriding the value there.
  
  [source]
  ----
  # Top key override
  clj -X:my-fn :config 789
  
  # Nested key override
  clj -X:my-fn '[:my :data]' 789
  ----
  
  If you want to execute an arbitrary function, you can do that with `-F`:
  
  [source]
  ----
  clojure [clj-opt*] -Fmy/fn [kpath v]*
  ----
  
  Pass the fully qualified function name with `-F` and then any number of key/value pairs for the invocation map:
  
  [source]
  ----
  clj -Fclojure.core/pr :a 1 :b 2
  ----
  
  === Quoting keys and values
  
  Key/value pairs are read as edn strings. A general rule is that you can surround edn data with single quotes `'data'` to get a literal string (which exec will read as edn data). In some cases (particularly numbers and keywords), you can omit the single quotes as bash does not have any conflicting interpretation.
  
  Note that strings must be passed in double quotes, also surrounded by single quotes to escape correctly with bash: `clj -X:my-fn :config '"foo"'`.
  
  
  == Running a main or script
  
  In other cases, the Clojure tools will invoke clojure.main to run either a namespace with a `-main` function or load a Clojure script.
  
  See the <<repl_and_main#,clojure.main>> documentation for more details.
  
  = Operation
  
  When you execute the Clojure tool, there are a series of steps performed to prepare and execute your command. This section is an overview of those steps, see later sections for how to modify those steps in a variety of ways.
  
  == Locate deps.edn sources
  
  Configuration is stored in one or more "deps.edn" maps. These are edn maps with the following top-level keys:
  
  * `:deps` - map of lib (symbol) to coordinate
  * `:paths` - vector of paths
  * `:aliases` - map of alias name to alias data
  * provider-specific keys for configuring dependency sources
  
  The Clojure tools look for 4 potential deps.edn sources:
  
  * Root - found in the installation of clj (or as a resource in tools.deps)
  * User - cross-project configuration (typically tools), usually found at `~/.clojure/deps.edn`
  * Project - the `deps.edn` in the current directory
  * Config data - a `deps.edn` map passed on the command line
  
  == Check cache
  
  The next several steps of this execution can be skipped if we have already computed the classpath and cached it. Classpath and the runtime basis files are cached in the current directory under `.cpcache/`. The key is based on the contents of the deps.edn files and some of the command arguments passed and several files will be cached, most importantly the classpath and runtime basis.
  
  If the key is found, and the cached files are newer than all deps.edn sources, they will be used and execution begins immediately.
  
  == Replace project environment ("tool")
  
  When you execute a tool in the context of your project, the tool uses its own paths and/or deps in place of the project's paths and/or deps.
  
  == Merge sources
  
  All deps.edn sources are merged into a single master edn file in the order listed above - root, user, project (possibly with tool replacements), config. This merged deps will be included in the runtime basis and used after this point.
  
  deps.edn sources is essentially `merge-with merge`, except for the `:paths` key, where only the last `:paths` found is used (they replace, not combine).
  
  == Resolve dependencies
  
  Starting from the master edn's merged :deps, the full transitive expansion of the dependency tree is computed. Dependency sources (procurers) are used to obtain metadata and other dependency information. At the completion of this step, all libraries to use in the execution have been found and downloaded to local files if needed.
  
  == Make classpath
  
  JVM execution relies on computing the classpath for the execution. The classpath will consist of the `:paths` in the merged `deps.edn` and the locations of all resolved dependencies.
  
  == Prepare JVM environment
  
  JVM arguments may either be passed on the command line (with `-J`) or by using data stored in an alias under `:jvm-opts` and passed with `-O` or `-A`
  
  == Execute command
  
  Finally the command is executed - see the Overview above for the execution options. The already computed (or loaded from cache) classpath, JVM environment, and main arguments if relevant are used in the execution. 
  
  = deps.edn
  
  The configuration file format (in `deps.edn` files) is an edn map with top-level keys `:deps`, `:paths`, and `:aliases`, plus provider-specific keys for configuring dependency sources.
  
  == Paths
  
  Paths are declared in a top level key `:paths` and are a vector of string paths or alias names. Relative paths are resolved in relation to the directory containing the deps.edn (the project root). These source paths will be added to the classpath.
  
  Example:
  
  [source,clojure]
  ----
  {:paths ["src"]}
  ----
  
  If used, alias names should refer to a path vector in the alias data:
  
  [source,clojure]
  ----
  {:paths [:clj-paths :resource-paths]
   :aliases
   {:clj-paths ["src/clj" "src/cljc"]
    :resource-paths ["resources"]}}
  ----
  
  == Dependencies
  
  Dependencies are declared in deps.edn with a top level key `:deps` - a map from library to coordinate. Libraries are symbols of the form `<groupID>/<artifactId>`. To indicate a Maven classifier, use `<groupId>/<artifactId>$<classifier>`.
  
  Coordinates can take several forms depending on the coordinate type:
  
  * Maven coordinate: `{:mvn/version "1.2.3"}`
  ** Other optional keys: `:exclusions`
  ** Note: `:classifier` is not supported - add to lib name as specified above
  * Local project coordinate: `{:local/root "/path/to/project"}`
  ** Optional key `:deps/manifest`
  *** Specifies the project manifest type
  *** Default is to auto-detect the project type (currently either `:deps` or `:pom`)
  * Local jar coordinate: `{:local/root "/path/to/file.jar"}`
  ** If the jar includes a pom.xml file, it will be used to find transitive deps
  * Git coordinate: `{:git/url "https://github.com/user/project.git", :sha "sha", :tag "tag"}`
  ** Required key `:git/url` can be one of the following:
  *** https - secure anonymous access to public repos
  
negative.code: == Tools
  
  See the project's wiki for a https://github.com/clojure/tools.deps.alpha/wiki/Tools[list of tools that use or work with tools.deps.alpha (or the clojure tools)] - tools for project creation, packaging, and much more.
  
  