Created
July 11, 2019 10:59
-
-
Save MalloZup/b7af3f7636ca6b26201dd98c1ea142ec to your computer and use it in GitHub Desktop.
local-jar-clojure.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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