Fork me on GitHub

Hello, Is there a way to deploy an uberjar instead of a jar to clojars using lein deploy?

Alex Miller (Clojure team)21:11:26

don’t deploy uberjars to Maven repos


@rahul080327 I would ask why you would want to deploy an uberjar? Uberjars that include one version of clojure produce strange errors when consumed by a project that uses another version of clojure.


...actually, reading further it looks like you could probably deploy an uberjar by lein deploy clojars 1.2.3 target/my-uber.jar


But yes, this is not what clojars is for

Alex Miller (Clojure team)21:11:55

uberjars embed deps, making them hidden and hard to change

Alex Miller (Clojure team)21:11:07

and if you deploy them, you are a Bad Person :)


I’ve found uberjar deploying to be useful from an internal company standpoint. If you want to deploy release artifacts that are released as uberjar apps

Alex Miller (Clojure team)21:11:41

jk, but I have wasted many hours of my life debugging stuff like this from maven repos

Alex Miller (Clojure team)21:11:58

so, internal deploys might be ok

Alex Miller (Clojure team)22:11:12

I’m talking about clojars / maven central


I meant “to be” auto correct said “ton” hah


Yeah, I think I’d agree on clojars/central and that sort of thing

Alex Miller (Clojure team)22:11:11

if it’s internal, you can at least track who did it and steal their office chair

😆 4

Also, we deploy them with a “classifier” of “standalone”


With that said. In terms of the root question (pending they didn’t wish to do it for malicious clojars/central deploy purposes) I can’t remember if you can coerce the plain lein deploy to do this. There are a few plugins out there to do similar, but we ended up with our own because we wanted a multi-classifier-artifact deploy task for various reasons.


The underlying deploy task impl can definitely take multiple artifacts and if they are named with appropriate classifier notation, they’ll be deployed with classifiers correctly.