views:

88

answers:

2

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?

+2  A: 

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.)

Michał Marczyk
Interesting. I could've sworn I used lein-clojars to push to Clojars, but maybe I did use scp. Nevertheless, thanks for an answer; it's been nigh impossible for me to find something online about this.
allie
Yeah, I was under the impression people *were* in fact somehow able to use lein-clojars myself, but it seems to be unsupported now and, as Phil says, using scp is easy enough...
Michał Marczyk
Another way to do it is to have hudson poll your SCM and auto-deploy to its own mvn repo. This way you get automated testing thrown in for free. I hope to document this process soon; it's not too tricky, and having a hudson server is very handy.
technomancy
@technomancy: Oh, great! I was going to look into Hudson. Guess I'll wait a bit and follow your write-up. :-)
Michał Marczyk
Maybe soon was not the right word... it might be a while. =) I don't think it's too tricky to figure out on your own.
technomancy
+1  A: 

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

Stuart Sierra