不搜索SBT maven本地存储库

时间:2014-12-25 11:14:41

标签: scala maven sbt

我想从本地maven repostory加载一些库。我已配置.sbt / 0.13 / plugins / plugins.sbt:

resolvers += Resolver.sonatypeRepo("snapshots")
resolvers += Resolver.mavenLocal

addSbtPlugin("org.ensime" % "ensime-sbt" % "0.1.5-SNAPSHOT")

在我的项目中,我在build.sbt中设置了这些行:

name := "hello"
version := "1.0"
scalaVersion := "2.10.4"
libraryDependencies += "opencv" % "opencv" % "2.4.9"
libraryDependencies += "opencv" % "opencv-native" % "2.4.9"

我无法弄清楚它为什么不起作用。在项目中运行sbt compile之后,它会记录下来:

[info] Resolving opencv#opencv;2.4.9 ...
[info] Resolving opencv#opencv;2.4.9 ...
[warn]  module not found: opencv#opencv;2.4.9

[warn] ==== local: tried
[warn]   C:\Users\Una\.ivy2\local\opencv\opencv\2.4.9\ivys\ivy.xml

[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/opencv/opencv/2.4.9/opencv-2.4.9.pom

[info] Resolving opencv#opencv-native;2.4.9 ...
[info] Resolving opencv#opencv-native;2.4.9 ...
[warn]  module not found: opencv#opencv-native;2.4.9

[warn] ==== local: tried
[warn]   C:\Users\Una\.ivy2\local\opencv\opencv-native\2.4.9\ivys\ivy.xml

[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/opencv/opencv-native/2.4.9/opencv-native
-2.4.9.pom

[info] Resolving org.scala-lang#scala-compiler;2.10.4 ...
[info] Resolving org.scala-lang#scala-reflect;2.10.4 ...
[info] Resolving org.scala-lang#jline;2.10.4 ...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: opencv#opencv;2.4.9: not found
[warn]  :: opencv#opencv-native;2.4.9: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

为什么它不能像在plugins.sbt中那样查看.m2 / repository?

我对scala和sbt没有经验。

1 个答案:

答案 0 :(得分:0)

将maven本地解析器移出plugins.sbt并移入build.sbt。如果您希望列出的快照解析器中列出的插件保留在plugins.sbt中,请将其删除,然后移至build.sbt。