Unresolved `restlet` sbt dependency - scala

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

Related

Scala sbt library dependency - module not found error

I am trying to add a dependency to json4, but I get a module not found error. I am using scala-version 2.12.4 and sbt-version 1.1.1. My other dependency additions seem to add in a normal way.
Here is my code in build.sbt:
scalaVersion := "2.12.4"
libraryDependencies += "io.spray" %% "spray-json" % "1.3.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % Test
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % Test
libraryDependencies += "org.json4s" %% "json4s-native" % "3.3.0"
This is the error message that I get:
[warn] module not found: org.json4s#json4s-native_2.12;3.3.0
[warn] ==== local: tried
[warn] /Users/*****/.ivy2/local/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/json4s/json4s-native_2.12/3.3.0/ json4s-native_2.12-3.3.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn] /Users/*****/.sbt/preloaded/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn] file:////Users/*****/.sbt/preloaded/org/json4s/json4s-native_2.12/3.3.0/ json4s-native_2.12-3.3.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.json4s#json4s-native_2.12;3.3.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
Help appreciated, thanks!
You need to use a newer version of this library.
Try this:
libraryDependencies += "org.json4s" %% "json4s-native" % "3.6.0-M3"
or some earlier version but not 3.3.0
Link to versions:
http://search.maven.org/#search%7Cga%7C2%7Cg%3A%22org.json4s%22
Edit: This problem is with compatibility. You use a new version of Scala and sbt. Previous version of this library are not compatible with this Scala version or sbt version.

libraryDependencies for com.eed3si9n#sbt-assembly;0.13.0: not found

I am building a sbt plugin and want to reference assembly task in the sbt-assembly plugin ( to be dependent on my task)
to do this i need to reference it as a library ( as opposed to a plugin), and somehow sbt is not able to resolve it as a libraryDepdendencies
this is what my sbt looks like
sbtPlugin := true
name := "my-sbt-plugin"
scalaVersion := "2.10.6"
sbtVersion := "0.13.0"
resolvers ++= Seq(Resolver.sbtPluginRepo("releases"), Resolver.sbtPluginRepo("snapshots"))
libraryDependencies ++= Seq(
"com.eed3si9n" % "sbt-assembly" % "0.13.0")
the output looks like
Resolving com.eed3si9n#sbt-assembly;0.13.0 ...
[warn] module not found: com.eed3si9n#sbt-assembly;0.13.0
[warn] ==== typesafe-ivy-releases: tried
[warn] https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[warn] ==== local: tried
[warn] /Users/myuser/.ivy2/local/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/com/eed3si9n/sbt-assembly/0.13.0/sbt-assembly-0.13.0.pom
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[warn] ==== sbt-plugin-snapshots: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.eed3si9n#sbt-assembly;0.13.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
It is not resolving because you did not specify a scala version. It should be something like:
libraryDependencies ++= Seq(
"com.eed3si9n" % "sbt-assembly_2.11" % "0.13.0"
)
Or, to automatically get the scala version used in project:
libraryDependencies ++= Seq(
// notice the double %% here
"com.eed3si9n" %% "sbt-assembly" % "0.13.0"
)
But, sbt-assembly is not supposed to be installed that way. The docs show that you must add the following line to your project/plugins.sbt instead:
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.2")
If developing an sbt plugin, the addSbtPlugin line has to go directly into ./build.sbt.
In my case, correcting the sbt assembly version from 14.3 to 14.5 did the trick. Please check what's yours and try that.
So in the project\assembly.sbt , it was like-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
Then I changed it to-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
Hope it helps!
It is not resolving for Scala - 2.12.
Add the following line in - project/plugins.sbt -
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
resolvers += Resolver.url("bintray-sbt-plugins", url("http://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
To find the proper path, try the following -
https://dl.bintray.com/sbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_<version>/
So, using version 2.12, the resolvable path can be found as below -
https://dl.bintray.com/sbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.5/ivys/
In addition to the above suggestions I had to add
resolvers += Resolver.url("bintray-sbt-plugins", url("http://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
to project/plugins.sbt.
I had the same issues, All I did was, remove the ==>
addSbtPlugin("com.eed3si9n" %% "sbt-assembly" % "0.14.5")
line from build.sbt and copied to another file, named assembly.sbt at the same project level, where build.sbt is.
It resolved the error.(After 3 hours of reading all posts on the internet. :-) )

How to set up blueeyes project in SBT?

I'm having trouble setting up this project using SBT.
It does not resolve blueeyes dependency when I type sbt run:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.reportgrid#blueeyes_2.9.1.RC1;0.4.19: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.reportgrid:blueeyes_2.9.1.RC1:0.4.19 (.../blueeyes-example/build.sbt#L19-22)
[warn] +- com.foo:blueeyes-test-api_2.9.1.RC1:0.1.0
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.reportgrid#blueeyes_2.9.1.RC1;0.4.19: not found
The BlueEyes project on Github seems abandoned but I hope there's still someone who can help me with this!
Form the documentation of the blueeyes repository, the dependencies should be declares like this:
resolvers ++= Seq(
"Sonatype" at "http://oss.sonatype.org/content/repositories/public",
"Typesafe" at "http://repo.typesafe.com/typesafe/releases/"
)
libraryDependencies ++= Seq(
"com.github.jdegoes" %% "blueeyes-core" % "0.6.0",
"com.github.jdegoes" %% "blueeyes-mongo" % "0.6.0",
"com.github.jdegoes" %% "blueeyes-json" % "0.6.0",
"ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime"
)
your library dependencies look a bit different:
libraryDependencies ++= Seq(
"com.reportgrid" % "blueeyes_2.9.1.RC1" % "0.4.19" % "compile"
)
UPDATE:
And scala version needs to be
scalaVersion := "2.9.1"
instead of
scalaVersion := "2.9.1.RC1"

Why can’t SBT resolve SecureSocial-snapshot dependency?

I want to use this SecureSocial snapshot for my project:
https://oss.sonatype.org/content/repositories/snapshots/ws/securesocial/securesocial_2.11/master-SNAPSHOT/
However SBT is unable to resolve it. Here is the error message:
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/ws/securesocial/securesocial_2.11/master-SNAPSHOT/securesocial_2.11-master-SNAPSHOT.pom
[warn] ==== typesafe-releases: tried
[warn] http://repo.typesafe.com/typesafe/releases/ws/securesocial/securesocial_2.11/master-SNAPSHOT/securesocial_2.11-master-SNAPSHOT.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/ws.securesocial/securesocial_2.11/master-SNAPSHOT/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] https://repo.typesafe.com/typesafe/releases/ws/securesocial/securesocial_2.11/master-SNAPSHOT/securesocial_2.11-master-SNAPSHOT.pom
[info] Resolving jline#jline;2.12 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: ws.securesocial#securesocial_2.11;master-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
Here are my resolvers and library dependencies:
Build.scala:
libraryDependencies ++= Seq(
"org.webjars" %% "webjars-play" % "2.3.0-3",
"org.logback-extensions" % "logback-ext-loggly" % "0.1.2",
"ws.securesocial" % "securesocial_2.11" % "master-SNAPSHOT"
)
plugins.sbt:
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
resolvers += "Sonatype OSS Releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
As far as I can tell this should work, but it doesn’t. What is the cause of this problem?
Versions info:
Scala version: 2.11.5
SBT version: 0.13.8
Play version: 2.3.7
The resolvers that you add for libraries should go in the build.sbt, not in the plugins.sbt. These two files are not cascaded and if you see the output from sbt it is not even trying to connect to Sonatype. Move this line in the build.sbt and it should work:
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
It is worth noting that you need to add resolvers in the plugins.sbt only when you want to include an sbt plugin that is not in the default repos.

scalacheck/scalatest not found: how to add it in sbt/scala?

I've installed typesafe-stack from http://typesafe.com/stack/download on my ubuntu12, than I created a play project (g8 typesafehub/play-scala) and now I want to add scalatest or scalacheck to my project.
So my_app/project/plugins.sbt has the following lines:
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0.1")
Then I added scalatest using addSbtPlugin:
addSbtPlugin("org.scalatest" %% "scalatest" % "2.0.M1" % "test")
and now it fails with the following message when I run 'sbt test'
[info] Resolving org.scalatest#scalatest;2.0.M1 ...
[warn] module not found: org.scalatest#scalatest;2.0.M1
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml
[warn] ==== local: tried
[warn] ~/.ivy2/local/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml
[warn] ==== Typesafe repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy- releases/org.scalatest/scalatest/scala_2.9.1/sbt_0.11.3/2.0.M1/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom
What I don't understand: why does it use this http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1_0.11.3/2.0.M1/scalatest-2.0.M1.pom URL instead of the real one http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.9.1/2.0.M1/scalatest_2.9.1-2.0.M1.pom?
Quite the same problem I have with scalacheck: it also tries to download using sbt-version specific artifactId whereas the repository has only scala-version specific.
What am I doing wrong? I understand there must be a switch in sbt somewhere, not to use sbt-version as part of the artifact URL?
I also tried using this in my plugins.sbt
libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M1" % "test"
but looks like it is completely ignored by sbt and scalatest.jar hasn't appeared in the classpath:
my_app/test/AppTest.scala:1: object scalatest is not a member of package org
[error] import org.scalatest.FunSuite
because the output of sbt clean && sbt test has lots of
Resolving org.easytesting#fest-util;1.1.6 or just another library, but nothing about scalatest.
I use scala 2.9.1 and sbt 0.11.3, trying to use scalatest 2.0.M1 and 1.8; scalacheck:
resolvers ++= Seq(
"snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
"releases" at "http://oss.sonatype.org/content/repositories/releases"
)
libraryDependencies ++= Seq(
"org.scalacheck" %% "scalacheck" % "1.9" % "test"
)
With the same outcome, i.e. it uses the sbtVersion specific POM URL, which doesn't exist.
What am I doing wrong? Thanks.
Scalatest is not a build plugin, but a testing library. You should add it like this:
libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M1" % "test"
And you should add it to build.sbt at the base directory of your project (which you referred to as "my_app"), not to project/plugins.sbt.
The reason it has 0.11.3 in the URL it tries to find is because build plugins are tied to the version of SBT you are using.
The plugins.sbt file and the addSbtPlugin are used to add sbt plugins. Not dependencies.
With the template you used, you should add your dependencies in the project/Build.scala. You will find a section with:
val appDependencies = Seq(
// Add your project dependencies here,
)
Replace it with:
val appDependencies = Seq(
"org.scalacheck" %% "scalacheck" % "1.9" % "test",
"org.scalatest" %% "scalatest" % "2.0.M1" % "test"
)
and it should work.