Question

I wrote a Clojure project using Leiningen and would now like to add the resulting jar to a Sonatype Nexus server. I installed lein-clojars, since this comes with a push command that seems to accept an optional repo arg if you would like to push somewhere besides Clojars. However, whenever I try this, I get a JSchException: Auth fail. It seems to indicate that there is an authentication problem somewhere.

I am able to scp the jar to Nexus, and I am also able to use this same settings.xml with Maven to upload to this machine, so I'm fairly confident these are both correct.

Is there any good way to use Leiningen to push to other repositories? Or is it really only built for Clojars?

Was it helpful?

Solution

A relevant exchange of e-mails happened a short while ago on the Leiningen Google group; see this message by Phil Hagelberg for the answer.

In short, it is apparently impossible to use DSA keys on the JVM. I'm not sure if/how Maven finds it possible to deal with this, but at any rate, lein-clojars doesn't. So, you should just stick to scp instead.

(Incidentally, this also means that lein-clojars is not really recommended for dealing with Clojars either. Also, I'm pretty sure that I'm missing some part of the picture, since apparently it used to work with Clojars. The one thing I am pretty sure about is that Leiningen won't be much help in pushing to protected repos at this time and that the message I linked to above is as close to an authoritative explanation of why this is that case as anything.)

OTHER TIPS

For the record, Leiningen 1.5 now has a deploy task that can push to Maven repositories like Nexus and Archiva over https: https://github.com/technomancy/leiningen/blob/master/src/leiningen/deploy.clj

If you're pushing to a real Maven repository, you're probably better off using Maven for deployment. There's a good Clojure plugin: http://github.com/talios/clojure-maven-plugin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top