2013-05-03 335 views
7

我在build.sbt如下定義:SBT不使用基於SSH的解析器來解決依賴

libraryDependencies += "com.bubblefoundry" %% "something" % "0.1-SNAPSHOT" 

resolvers += { 
    val privateKeyFile = new java.io.File(sys.env("HOME") + "/.ssh/id_rsa") 
    Resolver.ssh("Bubble Foundry", "bubblefoundry.com", "/usr/local/repository/") as ("peter", privateKeyFile) withPermissions("0644") 
} 

當SBT試圖解決的依賴,它失敗:

[info] Resolving com.bubblefoundry#something_2.10;0.1-SNAPSHOT ... 
[warn] module not found: com.bubblefoundry#something_2.10;0.1-SNAPSHOT 
[warn] ==== local: tried 
[warn] /Users/peter/.ivy2/local/com.bubblefoundry/something_2.10/0.1-SNAPSHOT/ivys/ivy.xml 
[warn] ==== Bubble Foundry: tried 
[warn] ==== public: tried 
[warn] http://repo1.maven.org/maven2/com.bubblefoundry/something_2.10/0.1-SNAPSHOT/something_2.10-0.1-SNAPSHOT.pom 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] ::   UNRESOLVED DEPENDENCIES   :: 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] :: com.bubblefoundry#something_2.10;0.1-SNAPSHOT: not found 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 

它看起來像它甚至沒有連接到服務器來尋找依賴關係。這是爲什麼?難道我做錯了什麼?

的依賴性已經發布(使用相同的解析器定義)/usr/local/repository/com/bubblefoundry/...

回答

-1

我發現了一個解決方案:從ssh開關sftp

resolvers += { 
    val privateKeyFile = new java.io.File(sys.env("HOME") + "/.ssh/id_rsa") 
    Resolver.sftp("Bubble Foundry", "bubblefoundry.com", "/usr/local/repository/") as ("peter", privateKeyFile) 
} 
+0

不適用於我。與ssh相同的行爲。 – scravy 2017-09-18 21:51:23

0

更新到SBT 0.13之後,我可以用我的通過添加以下行私人回購協議build.sbt

resolvers += Resolver.ssh("Company Maven Repo", "[email protected]:company/company-repo.git", "/raw/master") 

彈出一個對話框,詢問我的github用戶名和密碼


這是一個錯誤!

例如我使用github託管通過SSH訪問的私有/內部maven repo。如您所期望的那樣,使用Maven/POM文件時,我可以毫無困難地拖放工件。

但無法讓SBT(0.12.2)正常工作。最令人沮喪的,它只是說

== REPO_NAME: tried 

即使我指定無效的認證或給個差SSH URL它同樣即沒有錯誤報告。

花了幾個小時研究和嘗試組合無濟於事。因此,我建議SSH回購無法正常工作。

+0

'resolvers + = Resolver.ssh(「Company Maven Repo」,「[email protected]:company/company-repo.git」,「/ raw/master」)'不適合我...您可以發佈信息嗎?更多細節? – mkurz 2016-01-25 15:27:30

+1

我有類似的問題;對於SSH和SFTP解析器,SBT顯然不會嘗試連接和檢索僞像(正如Dominic所描述的那樣)。但是,如果我提供'Patterns'(如[對SBT問題#1810的評論](https://github.com/sbt/sbt/issues/1810#issuecomment-160608021)所述),它會使嘗試,但它只要求'ivy.xml'(但不是POM)。 – 2016-02-12 14:23:45