最佳答案
我在本地仓库中遇到了 Maven 依赖关系的问题。
SBT 找不到它。已经将日志级别设置为调试,但是没有得到任何新的内容。
文件在存储库中。我将粘贴路径从控制台复制到文件资源管理器,它们就在那里。
输出:
[debug] trying file://c:/Users/userz/.m2/repository/com/twitter/naggati/2.0.0/naggati-2.0.0.pom
[debug] tried file://c:/Users/userz/.m2/repository/com/twitter/naggati/2.0.0/naggati-2.0.0.pom
[debug] Local Maven Repository: resource not reachable for com/twitter#naggati;2.0.0: res=file://c:/Users/userz/.m2/repository/com/twitter/naggati/2.0
.0/naggati-2.0.0.pom
[debug] trying file://c:/Users/userz/.m2/repository/com/twitter/naggati/2.0.0/naggati-2.0.0.jar
[debug] tried file://c:/Users/userz/.m2/repository/com/twitter/naggati/2.0.0/naggati-2.0.0.jar
[debug] Local Maven Repository: resource not reachable for com/twitter#naggati;2.0.0: res=file://c:/Users/userz/.m2/repository/com/twitter/naggati/2.0
.0/naggati-2.0.0.jar
[debug] Local Maven Repository: no ivy file nor artifact found for com.twitter#naggati;2.0.0
编辑: 我在 project/build 中使用 scala 文件添加了路径,就像在 href = “ http://code.google.com/p/simple-build-tool/wiki/libraryManagement”> http://code.google.com/p/simple-build-tool/wiki/librarymanagement 中描述的那样
“ sbt 可以搜索您的本地 Maven 存储库,如果您将其作为存储库添加的话:”
val mavenLocal = "Local Maven Repository" at "file://"+Path.userHome+"/.m2/repository"
这使 sbt 在本地存储库中查找。
Scala 文件是这样的:
import sbt._
class Foo(info: ProjectInfo) extends DefaultProject(info) {
val mavenLocal = "Local Maven Repository" at "file://c:/Users/userz/.m2/repository"
}
(我对 Path.userHome 进行了硬编码,以排除可能的错误原因。