Skip to content

Instantly share code, notes, and snippets.

@MalloZup
Created July 11, 2019 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MalloZup/b7af3f7636ca6b26201dd98c1ea142ec to your computer and use it in GitHub Desktop.
Save MalloZup/b7af3f7636ca6b26201dd98c1ea142ec to your computer and use it in GitHub Desktop.
local-jar-clojure.md
# Rationale:
This is a quick guide for using local jars in #clojure.
# create project with lein
```
lein new foo
cd foo
```
Say I have a random JAR file that is not available in any repository:
```
touch README.md
jar cf bar.jar README.md
````
```
mkdir repo
mvn deploy:deploy-file -DgroupId=local -DartifactId=bar \
-Dversion=1.0.0 -Dpackaging=jar -Dfile=bar.jar \
-Durl=file:repo
And I write my project.clj like this:
(defproject foo "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.4.0"]
[local/bar "1.0.0"]]
:repositories {"project" "file:repo"})
```
### test with:
```lein deps```
# References:
1) historic one: https://gist.github.com/stuartsierra/3062743
2) an example: https://github.com/thehammer/jukebox2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment