当前位置: 动力学知识库 > 问答 > 编程问答 >

scala - Unresolved `restlet` sbt dependency

问题描述:

I am trying to add the blueprints-sail-graph (located here) dependency via sbt, and it is having trouble resolving one of the sail dependencies. I am new to Java/Scala development and will really appreciate your help! The following is my build.sbt file:

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/"

The error I get from sbt is:

[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

The warnings above this error message are:

[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

I know that the sail dependency is the issue becuase if I remove it, sbt compiles without a problem. I added the additional resolvers hoping that one of them would contain this jar -- in fact JBoss appears to, but for some reason it still did not work. I also tried many different versions of blueprints-sail-graph unsuccessfully. I am not sure what else to do, please help me get this dependency resolved.

Thanks for all the help!

EDIT: According to another post, this jar needs to be specifically added to Ivy -- hope that saves someone some time. I tried a few things with Ivy but did not succeed :(

网友答案:

Add the following to list of resolvers:

resolvers += "Restlet Repositories" at "http://maven.restlet.org"

By the way you can use sbt predefined attributes. The whole sbt build file will be like this:

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"
)
分享给朋友:
您可能感兴趣的文章:
随机阅读: