2014-10-03 30 views
1

我引用了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

回答

1

亞歷克斯指出,這是神器本身有問題,不能與leiningen。