SBT无法解决Sonatype repo上存在的依赖关系

时间:2015-02-10 03:08:35

标签: scala sbt uima

我正在尝试在项目中包含一个名为uimascala的依赖项。它可以在Sonatype存储库中使用,但由于某些原因,SBT无法找到它。这是我的build.sbt。

val sparkCore = "org.apache.spark" % "spark-core_2.10" % "1.2.0"
val uimaScala = "com.github.jenshaase.uimascala" % "uimascala-core_2.10" % "0.5.0-SNAPSHOT"

// test deps
val specs2 = "org.specs2" %% "specs2-core" % "2.4.15" % "test"

lazy val commonSettings = Seq(
  organization := "foo",
  version := "0.1.0",
  scalaVersion := "2.10.4"
)

lazy val `twitter-sentiment-stream` = (project in file(".")).
  settings(commonSettings: _*).
  settings(
    name := "bar",
    resolvers ++= Seq(
      //"Sonatype OSS Releases"  at "http://oss.sonatype.org/content/repositories/releases/",
      "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
    ),
    libraryDependencies ++= Seq(sparkCore, uimaScala, specs2)
  )

addCompilerPlugin("org.scalamacros" % "paradise" % "2.0.1" cross CrossVersion.full)

当我尝试构建项目时,我的输出中出现以下错误,但是当我检查它尝试的URL时它是有效的。

[warn] ==== Sonatype OSS Snapshots: tried
[warn]   http://oss.sonatype.org/content/repositories/snapshots/com/github/jenshaase/uimascala/uimascala-core_2.10/0.5.0-SNAPSHOT/uimascala-core_2.10-0.5.0-SNAPSHOT.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.github.jenshaase.uimascala#uimascala-core_2.10;0.5.0-SNAPSHOT: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: com.github.jenshaase.uimascala#uimascala-core_2.10;0.5.0-SNAPSHOT: not found

2 个答案:

答案 0 :(得分:11)

我怀疑手动键入的解析器网址。我能够使用sbt 0.13.7进行以下更改来解析您的库:

resolvers ++= Seq(
  Resolver.sonatypeRepo("public"),
  Resolver.bintrayRepo("scalaz", "releases")
)

现在可能需要https

答案 1 :(得分:3)

对于更短的版本,您可以使用Opts.resolver.sonatypeSnapshots代替自定义解析器。