如何强制lein deps重新获取本地jar / libs [英] How to force lein deps to re-fetch local jars/libs

查看:360
本文介绍了如何强制lein deps重新获取本地jar / libs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下说明:



http://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/



我安装了一些本地jar到本地仓库。



当我想更新我的项目中的jar时,我重新安装jar到存储库,然后运行lein deps。我发现,不知何故,这个jar没有在我的项目中更新。即使我rm -rf libs文件夹中的所有内容,新的jar不被拾起。我唯一能够得到这个工作的方法是更改​​jar的名称。



这是奇怪的,因为即使我已经删除了旧jar的所有痕迹(据我所知),lein隐藏快照/缓存libs?

解决方案

leinigen将maven用于依赖关系mgmt。 maven默认存储它的仓库

  $ HOME / .m2 / repository 

在leiningen版本2之前,依赖项将被复制到< projecthome> / lib 版本2及更高版本构建了直接指向存储库的类路径。



因此,删除本地maven仓库中的jar,您应该强制(重新)下载。 >

或者,知道对于快照依赖关系,maven只会每天检查一次快照的新版本(默认情况下)。 在maven中,你可以强制使用-U标志。我不认为leiningen暴露,但你可以做... 。 (但看到barry-wark的回答)

 #在开始复制之前强制更新快照
$ lein -U repl


using the following instructions:

http://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/

I installed some local jars into local repository.

When I want to update the jar in my project, I re-install the jar into the repository and then run lein deps. I am finding that somehow, the jar is not updated in my project. Even when I rm -rf everything in the libs folder, the new jar is not picked up. The only way I have been able to get this to work is to change the name of the jar.

Its sort of odd because this occurs even when I have deleted all traces of the old jar (as far as I know) -- does lein hide a snapshot/cache of libs?

解决方案

leinigen uses maven for dependency mgmt. maven by default stores it's repo in

$HOME/.m2/repository

Prior to leiningen version 2, the dependencies would be copied to <projecthome>/lib, but version 2 and later builds a classpath pointing directly to the repository.

So delete the jar in your local maven repo and you should force a (re)download.

alternatively, it's useful to know that for snapshot dependencies, maven will only check for new versions of the snapshot once a day (by default). In maven you can force it using the -U flag. I don't think leiningen expose that, but you could do.... (but see answer from barry-wark)

# force update of snapshots before starting repl
$ lein -U repl

这篇关于如何强制lein deps重新获取本地jar / libs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆