简体   繁体   English

如何在防火墙后面安装Leiningen软件包?

[英]How can I install Leiningen packages behind a firewall?

I use a local library to do some development, but the firewall prevents alot of internet sites. 我使用本地库进行一些开发,但是防火墙阻止了许多Internet站点。 Is there a way to download artifacts manually? 有没有办法手动下载工件?

My project.clj is: 我的project.clj是:

https://github.com/zubairq/coils/blob/master/project.clj?

Update 更新资料

From the comments given I am understanding that the steps to take are: 从给出的评论中,我理解要采取的步骤是:

1) Install Maven

2) Find out which jars are in my project (How can I do this based on my project.clj?)

Dependency Tree 依赖树

In order to figure out which jars your project needs you can do: 为了弄清楚您的项目需要哪些罐子,您可以执行以下操作:

$ lein deps :tree

Which will show you something that is called a "dependency tree". 这将向您显示称为“依赖树”的内容。 It will look similar to: 它看起来类似于:

 [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"]
   ...

Installing Jars with Lein 用Lein安装Jars

One simple way to install manually downloaded jars would be to use " lein-localrepo ": 安装手动下载的jar的一种简单方法是使用“ lein-localrepo ”:

$ lein localrepo install [-r repo-path] 
                         [-p pom-file] 
                         <filename> 
                         <[groupId/]artifactId> 
                         <version>

Here are a couple of examples (given that you have downloaded the jars): 以下是一些示例(假设您已经下载了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

Take a look at the documentation for more features and examples. 查看文档以获取更多功能和示例。

Installing lein-localrepo 安装lein-localrepo

You can install lein-localrepo as a plugin by adding the following to your ~/.lein/profiles.clj : 您可以通过将以下内容添加到~/.lein/profiles.clj来将lein-localrepo安装为插件:

{:user {:plugins [[lein-localrepo "0.5.2"]]}}

Lein Behind a Proxy Server Lein在代理服务器后面

In case it is "ok" to use a proxy server, you can add it to ~/.lein/profiles.clj under jvm-opts 如果可以使用代理服务器,可以将其添加到jvm-opts下的~/.lein/profiles.clj

{:user {:jvm-opts ["-Dhttp.proxyHost=168.1.1.104" "-Dhttp.proxyPort=8080"]}}

where user is a profile name to use. 其中user是要使用的配置文件名称。

Or you can export http_proxy environment variable before launching lein . 或者,您可以在启动lein之前导出http_proxy环境变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM