1

I have recently started using play with scala and akka and I am just playing with it. I have installed scala-ide, gst and hopefully everything that is needed. However, when working in the scala-ide(..eclipse?) my code editor is covered with a lot of "not found" errors that mainly come from sbt dependencies. To be specific, my build.sbt file looks like this:

name := """testApp"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.1"

libraryDependencies ++= {
val akkaV = "2.3.6"
val sprayV = "1.3.2"
Seq(
"io.spray" %% "spray-can" % sprayV,
"io.spray" %% "spray-routing" % sprayV,
"io.spray" %% "spray-testkit" % sprayV % "test",
"com.typesafe.akka" %% "akka-actor" % akkaV,
"com.typesafe.akka" %% "akka-testkit" % akkaV % "test",
"com.typesafe.akka" %% "akka-contrib" % "2.3.7",
"org.webjars" % "bootstrap" % "3.0.0",
"org.webjars" % "knockout" % "2.3.0",
"org.webjars" % "requirejs" % "2.1.11-1",
"org.webjars" % "leaflet" % "0.7.2",
"org.webjars" % "rjs" % "2.1.11-1-trireme" % "test",
"org.webjars" % "squirejs" % "0.1.0" % "test",
"org.specs2" %% "specs2-core" % "2.3.11" % "test"
)
}

but still, scala-ide fails to load import spray.http._ or import akka.contrib.pattern.DistributedPubSubExtension (both are covered with errors when importing like "object contrib is not a member of package akka"). Sbt compiles the project with success and also I can easily run the app with ./activator run

Matej Briškár
  • 599
  • 4
  • 17
  • 1
    Have you run sbt eclipse ? The scala IDE does not use the sbt files. The sbt eclipse plugin will generate a proper eclipse project with appropriate dependencies. You may need to look at https://github.com/typesafehub/sbteclipse/ – Didier Dupont Dec 23 '14 at 21:27
  • Thank you for really fast response, it was really it! Will I need to run this "eclipse" command everytime I will change build.sbt file? Feel free to write this as an answer :) Oh and is there a support in IDE to automaticlly search for dependencies? – Matej Briškár Dec 23 '14 at 21:40
  • 1 - yes you rerun the command every time you change the dependencies (I believe eclipse will refresh automatically). 2 - none that I know of – Didier Dupont Dec 23 '14 at 21:47

0 Answers0