You will need to setup a local maven repository, but that can be a simple directory, in your project directory, that you then check in to source control. (Which will maintain your 'check out and run' policy)
As of Leiningen 2.2.0 the functionality to deploy jars is built-in with the lein deploy
task. So, the task has simplified from previous versions.
Create a directory inside your project called, in this example, myrepo
. (The name is arbitrary)
Add a :repositories
entry in your project.clj
file with a path to the local directory you created.
:repositories [["localrepo1" "file:myrepo"]]
Deploy your free floating jar to the repo.
lein deploy localrepo1 com.blueant/fancypants 1.0.1 fancypants.jar
And, add your dependency to your project.clj :dependencies
vector as normal.
:dependencies [[com.blueant/fancypants "1.0.1"]]
The deploy task will generate the checksums and directory structure required to to tie into the lein dependency resolution. You can verify your jar is loaded correctly with the lein deps :tree
command.
Note: File paths in :repositories
are formatted as URLs. So, /Users/user1/Desktop
is file:///Users/user1/Desktop
, and, a local directory within the project, myrepo
is file:myrepo
.