【发布时间】:2018-02-14 11:27:58
【问题描述】:
我的 project.clj 文件看起来像 -
(defproject somename "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[org.apache.kafka/kafka-clients "0.11.0.2"]]
:main somename.core
:target-path "target/%s"
:profiles {:dev {:dependencies [[lein-light-nrepl "0.3.3"]
[enlive "1.1.6"]
[cheshire "5.8.0"]
[criterium "0.4.4"]]}}
:repl-options {:nrepl-middleware [lighttable.nrepl.handler/lighttable-ops]})
lein repl 在项目目录之外工作正常。
$ lein repl
nREPL server started on port 34420 on host 127.0.0.1 -
nrepl://127.0.0.1:34420
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_161-b12
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=>
但是,对于这个项目,当我在做lein deps 时,它无法拉取依赖项。
我收到一个错误,例如-
Could not transfer artifact org.apache.kafka:kafka-
clients:pom:0.11.0.2 from/to central (https://repo1.maven.org/maven2/): Connect to [localhost/127.0.0.1] failed: Connection refused (Connection refused)
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
lein和java版本如下-
$ lein version
Leiningen 2.7.1 on Java 1.8.0_161 Java HotSpot(TM) 64-Bit Server VM
$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
请帮帮我。
【问题讨论】:
-
我不确定 lein 是否使用
$HOME/.m2/settings.xml- 也许你在那里定义了一些localhost镜像? -
@PiotrekBzdyl 我的
.m2目录中没有这样的文件。 -
http代理环境变量呢?
标签: java clojure localhost leiningen