Deploying to Clojars with the new tokens

Table of Contents

img

With a recent, well-deserved funding round to the Clojars repository 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 unanswered question is how I adjust my setup to USE the token. So, here it is with Leiningen.

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}]]

credentials.clj

The necessary change is in my ~/.lein/credentials.clj.gpg file, which is created as per the link above for making a GPG encrypted Leiningen 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 clojars-generated 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
Full-time Web App Engineer, Digital Humanist, Researcher, Computer Psychologist