Repository Management with Nexus

4.10. Leiningen

Leiningen has a built in dependency management
component and defaults to the Maven repository format. As a build tool
it is mostly used for projects using the Clojure
language. Many libraries useful for these projects are published to
the Clojars repository.

If you want use Nexus with Leiningen, first create two new Maven 2 proxy
repositories in Nexus with the remote URL http://clojars.org/repo/.
One of these should have the Repository Policy set to Release and the
other should have policy Snapshot. Then add both to your Maven 2 public group.

In order to configure a Leinigen project to resolve dependencies declared in
the project.clj file, a mirrors section overriding the built in central
and clojars repositories as shown in Minimal Leiningen Configuration has to be declared.

These minimal settings allow Leiningen to download the declared
dependencies.

To deploy build outputs to a Nexus repository with the deploy
command, the target repositories have to be add to project.clj as
deploy-repositories. This avoids Leiningen checking for dependencies
in these repositories, which is not necessary, since they are already
part of the Nexus public repository group used in mirrors.