我使用本地库进行一些开发,但防火墙会阻止很多互联网站点。有没有办法手动下载工件?
我的project.clj是:
https://github.com/zubairq/coils/blob/master/project.clj?
从给出的评论中我了解到要采取的步骤是:
1) Install Maven
2) Find out which jars are in my project (How can I do this based on my project.clj?)
答案 0 :(得分:7)
为了确定您的项目需要哪些罐子,您可以这样做:
$ lein deps :tree
这将向您展示一种称为“依赖树”的东西。它看起来类似于:
[clj-time "0.5.0"]
[joda-time "2.2"]
[clojure-complete "0.2.3"]
[org.myproject/some-proto "0.0.1-20130523.145830-9"]
[org.flatland/protobuf "0.7.2"]
[ordered-collections "0.4.0"]
[org.flatland/schematic "0.1.0"]
[org.flatland/useful "0.9.0"]
[com.datomic/datomic-free "0.8.3862"]
...
安装手动下载的jar的一种简单方法是使用“lein-localrepo”:
$ lein localrepo install [-r repo-path]
[-p pom-file]
<filename>
<[groupId/]artifactId>
<version>
以下是一些示例(假设您已下载了jar):
$ lein localrepo install foo-1.0.6.jar com.example/foo 1.0.6
$ lein localrepo install foomatic-1.3.9.jar foomatic 1.3.9
请查看documentation了解更多功能和示例。
您可以在lein-localrepo
添加以下内容,将~/.lein/profiles.clj
作为插件安装:
{:user {:plugins [[lein-localrepo "0.5.2"]]}}
如果使用代理服务器“ok”,您可以将其添加到~/.lein/profiles.clj
下的jvm-opts
{:user {:jvm-opts ["-Dhttp.proxyHost=168.1.1.104" "-Dhttp.proxyPort=8080"]}}
其中user
是要使用的个人资料名称。
或者您可以导出http_proxy
环境变量before launching lein。