Deploying to Clojars with the new tokens :clojure: clojars: deployment: token: leinengen: credentials:

Table of Contents

With a recent, well-deserved funding round to the Clojars respository project, the password you log in to the site with is no longer valid as the password with which you publish deployments. See https://github.com/clojars/clojars-web/wiki/Deploy-Tokens and https://clojars.org/tokens . The annoyingly unsanswered question is how I adjust my setup to USE the token. So, here it is with Leinengen.

Project.clj

I have the following in my project.clj, which is the same as I had before switching from my web password to the token:

:repositories [["releases" {:url "https://repo.clojars.org"
                              :creds :gpg}]]

The necessary change is in my ~/.lein/credentials.clj.gpg file, which is created as per the link above for making a GPG encrypted leinengen credentials thing. You simply swap in the token instead of the password. In the end my credentials.clj.gpg looks like this:

;; ~/.lein/credentials.clj.gpg
{#"clojars"
 {:username "my-web-login-name" :password "CLOJARS_MUMBOJUMBO"}}
 ;; :password is the given token, which seems to begin with CLOJARS_ 

That’s it; then a simple lein deploy clojars did the trick. Now you know.

Tory Anderson avatar
Tory Anderson
Web App Engineer, Digital Humanist, Researcher, Computer Psychologist