Skip to content

Instantly share code, notes, and snippets.

@ricardclau
Created October 10, 2014 10:30
Show Gist options
  • Save ricardclau/fb9822cb0b9660d2dbeb to your computer and use it in GitHub Desktop.
Save ricardclau/fb9822cb0b9660d2dbeb to your computer and use it in GitHub Desktop.
Akka problems
# build.sbt
name := "akka-chat"
version := "1.0"
resolvers += "spray repo" at "http://repo.spray.io"
libraryDependencies ++= Dependencies.demoAkka
# project/Depedencies.scala
object Library {
// Versions
val akkaVersion = "2.3.3"
val logbackVersion = "1.0.13"
val sprayVersion = "1.3.2"
// Libraries
val akkaActor = "com.typesafe.akka" %% "akka-actor" % akkaVersion
val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % akkaVersion
val logbackClassic = "ch.qos.logback" % "logback-classic" % logbackVersion
val sprayCan = "io.spray" % "spray-can" % sprayVersion
}
object Dependencies {
import Library._
val demoAkka = List(akkaActor, akkaSlf4j, logbackClassic, sprayCan)
}
# IntelliJ error
Error:[info] Loading project definition from /projects/akka-chat/project
[error] /projects/akka-chat/project/Dependencies.scala:9: value % is not a member of String
[error] val akkaActor = "com.typesafe.akka" % "akka-actor" % akkaVersion
[error] ^
[error] /projects/akka-chat/project/Dependencies.scala:10: value % is not a member of String
[error] val akkaSlf4j = "com.typesafe.akka" % "akka-slf4j" % akkaVersion
[error] ^
[error] /projects/akka-chat/project/Dependencies.scala:11: value % is not a member of String
[error] val logbackClassic = "ch.qos.logback" % "logback-classic" % logbackVersion
[error] ^
[error] /projects/akka-chat/project/Dependencies.scala:12: value % is not a member of String
[error] val sprayCan = "io.spray" % "spray-can" % sprayVersion
[error] ^
[error] four errors found
[error] (compile:compile) Compilation failed
@magic890
Copy link

magic890 commented Jan 2, 2015

You can fix it in this way:
val sprayCan = "io.spray" %% "spray-can" % sprayVersion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment