Occasionally one needs to use a hacked .jar:
- You need to modify a .jar (clojure/java) in-place
- You built a cljsjs package, and want to upload the generated .jar
- There's some obscure java .jar that is not in Maven.
Leiningen support for floating jars has never been official, and doesn't seem to work with cljsjs.
So one has to publish the jar to a Maven repo.
Local repos are bit of a hassle, and not shareable either obviously.
This is the easiest approach I could find to upload / depend on an arbitrary jar:
- Sign up on mymavenrepo.com .
- Use the following command:
mvn deploy:deploy-file -DgroupId=vemv \
-DartifactId=react-dates \
-Dversion=12.2.4-1 \
-Dpackaging=jar \
-Dfile=react-dates-12.2.4-1.jar \
-DrepositoryId=mymavenrepo \
-Durl=YOUR_MYMAVENREPO_WRITE_URL
That should be it. No password or xml files required!
Then, in project.clj:
:repositories [["vemv" "YOUR_MYMAVENREPO_READ_URL"]]
:dependencies
...
[vemv/react-dates "12.2.4-1"]
...