Search code examples
clojureleiningen

Lein clean and re-download dependencies


I'm working on setting up some password protected dependency repositories. I'd like to clear all dependency packages and re-download to make sure the package restore is working correctly.

How should I clear the lein package cache?


Solution

  • If there are no edge cases by additional plugins rm -rf ~/.m2/repository is the brute force version -- this removes all deps ever downloaded by Leiningen (and also Maven and maybe others).

    If you want to be very specific for a certain project, you can get the list of all actual files by lein cp (Warning: this also contains your source files! So you usually want the ones in ~/.m2/repository. Of course you use version control and have backups and therefor no problem here...). From the list of lein cp you would at least want to remove the dirname portion to kill the version, or go up two for the whole artifact.