我正在尝试通过sbt添加blueprints-sail-graph
(located here)依赖项,并且无法解析其中一个sail
依赖项。我是Java / Scala开发的新手,非常感谢您的帮助!以下是我的build.sbt
文件:
scalaVersion := "2.10.3"
libraryDependencies ++= Seq(
"org.scalatest" % "scalatest_2.10" % "2.0" % "test" withSources() withJavadoc(),
"org.scalacheck" %% "scalacheck" % "1.10.0" % "test" withSources() withJavadoc(),
"com.tinkerpop.blueprints" % "blueprints-rexster-graph" % "2.6.0" withSources() withJavadoc(),
"com.tinkerpop.blueprints" % "blueprints-sail-graph" % "2.5.0"
)
unmanagedBase := baseDirectory.value / "lib"
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
resolvers += "Scala-Tools Maven2 Snapshots Repository" at "http://scala-tools.org/repo-snapshots"
resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"
resolvers += "JBoss repository" at "https://repository.jboss.org/nexus/content/repositories/"
我从sbt得到的错误是:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.restlet.jse#org.restlet;2.1.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.restlet.jse#org.restlet;2.1.1: not found
此错误消息上方的警告是:
[info] Resolving org.restlet.jse#org.restlet;2.1.1 ...
[warn] module not found: org.restlet.jse#org.restlet;2.1.1
[warn] ==== local: tried
[warn] /home/d2b2/.ivy2/local/org.restlet.jse/org.restlet/2.1.1/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.pom
[warn] ==== Sonatype OSS Snapshots: tried
[warn] https://oss.sonatype.org/content/repositories/snapshots/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.pom
[warn] ==== Scala-Tools Maven2 Snapshots Repository: tried
[warn] http://scala-tools.org/repo-snapshots/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.pom
[warn] ==== Local Maven Repository: tried
[warn] file:///home/d2b2/.m2/repository/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.pom
[warn] ==== JBoss repository: tried
[warn] https://repository.jboss.org/nexus/content/repositories/org/restlet/jse/org.restlet/2.1.1/org.restlet-2.1.1.pom
我知道sail
依赖是问题,如果我删除它,sbt编译没有问题。我添加了额外的解析器,希望其中一个包含这个jar - 事实上JBoss
似乎,但由于某种原因它仍然无效。我还尝试了许多不同版本的blueprints-sail-graph
失败。我不知道还能做什么,请帮我解决这个问题。
感谢您的帮助!
编辑:根据另一个post,这个jar需要专门添加到常春藤 - 希望能节省一些时间。我和常春藤试了一些东西,但没有成功:(
答案 0 :(得分:3)
将以下内容添加到解析器列表中:
resolvers += "Restlet Repositories" at "http://maven.restlet.org"
顺便说一句,您可以使用sbt
预定义属性。整个sbt
构建文件将如下所示:
import sbt.Resolver.mavenLocal
scalaVersion := "2.10.3"
unmanagedBase := baseDirectory.value / "lib"
resolvers ++= Seq(
mavenLocal,
"Restlet Repository" at "http://maven.restlet.org/",
"JBoss Repository" at "https://repository.jboss.org/nexus/content/repositories/",
"Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
"Scala-Tools Snapshots" at "http://scala-tools.org/repo-snapshots/"
)
libraryDependencies ++= Seq(
"org.scalatest" % "scalatest_2.10" % "2.0" % "test" withSources() withJavadoc(),
"org.scalacheck" %% "scalacheck" % "1.10.0" % "test" withSources() withJavadoc(),
"com.tinkerpop.blueprints" % "blueprints-rexster-graph" % "2.6.0" withSources() withJavadoc(),
"com.tinkerpop.blueprints" % "blueprints-sail-graph" % "2.5.0"
)