如何在防火墙后面安装 Leiningen 软件包? [英] How can I install Leiningen packages behind a firewall?

查看:18
本文介绍了如何在防火墙后面安装 Leiningen 软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用本地库进行一些开发,但防火墙阻止了很多 Internet 站点.有没有办法手动下载工件?

I use a local library to do some development, but the firewall prevents alot of internet sites. Is there a way to download artifacts manually?

我的 project.clj 是:

My project.clj is:

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?)

推荐答案

依赖树

为了确定您的项目需要哪些 jar,您可以执行以下操作:

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

使用 Lein 安装 Jars

安装手动下载的 jar 的一种简单方法是使用lein-localrepo":

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

这里有几个例子(假设你已经下载了 jars):

Here are a couple of examples (given that you have downloaded the jars):

$ 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.

您可以通过将以下内容添加到您的 ~/.lein/profiles.clj 中,将 lein-localrepo 作为插件安装:

You can install lein-localrepo as a plugin by adding the following to your ~/.lein/profiles.clj:

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

<小时>

代理服务器背后的Lein

如果使用代理服务器可以",您可以将其添加到jvm-opts下的~/.lein/profiles.clj

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

其中 user 是要使用的配置文件名称.

where user is a profile name to use.

或者您可以在启动 lein 之前导出 http_proxy 环境变量 /a>.

Or you can export http_proxy environment variable before launching lein.

这篇关于如何在防火墙后面安装 Leiningen 软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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