Leiningen无法解析包含一个破折号

问题描述:

我引用了Leiningen项目文件只有一个单一的额外的依赖依赖:Leiningen无法解析包含一个破折号

(defproject foo-bar "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 [ 
       [com.github.sharispe/slib-sml "0.9"] 
       [org.clojure/clojure "1.5.1"]         
       ]) 

lein test抱怨:

lein test 
Could not find artifact com.github.sharispe:slib:pom:0.9 in central (https://repo1.maven.org/maven2/) 
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. 
Tests failed. 

注意,POM的神器ID不正确,-sml部分被放置...罐子是在*,当然:

lein search slib-sml 
Searching over Artifact ID... 
== Showing page 1/1 
[com.github.sharispe/slib-sml "0.9"] Semantic measures library 

有人知道为什么lein似乎放弃了工件ID的-sml部分?我知道破折号不符合clj的命名约定,但在外部依赖的情况下,这应该是正常的。

(顺便说一句:lein --version Leiningen 2.5.0 on Java 1.7.0_67 Java HotSpot(TM) 64-Bit Server VM) - 是的,我有一个工作的Internet连接:)

+0

'com.github.sharispe/slib-sml'工件列出了'com.github.sharispe/slib'作为其父项。我怀疑lein试图在依赖关系解析期间获取父POM,当父项不可用时失败。 – Alex 2014-10-03 15:27:16

+0

你是对的,我很愚蠢,谢谢:)这是神器的问题,而不是与leiningen。 – 2014-10-03 15:28:43

+0

您可以通过抓取父POM并将其存储在项目中的本地回购库(并在project.clj中使用:local-repo密钥)来解决此问题。 – Alex 2014-10-03 15:49:50

亚历克斯指出,这是神器本身有问题,不能与leiningen。