Not able to use gatling plugin with play 2.3.x and sbt 0.13.5

Hi ,

I have been banging my head over this but couldn’t get it to work. My plugins.sbt file looks like this -

resolvers ++= Seq(“typesafe” at “http://repo.typesafe.com/typesafe/releases/”, Resolver.url(
“gatling-sbt-plugins”,
url(“http://dl.bintray.com/content/gatling/sbt-plugins/”))(Resolver.ivyStylePatterns))

addSbtPlugin(“com.typesafe.play” % “sbt-plugin” % “2.3.4”)

addSbtPlugin(“io.gatling” % “gatling-sbt” % “2.1.6”)

Made these changes to build.scala -

lazy val typesafeSnapshot = “Typesafe Snapshots Repository” at “http://repo.typesafe.com/typesafe/snapshots/
lazy val typesafe = “Typesafe Repository” at “http://repo.typesafe.com/typesafe/releases/

lazy val gatlingTest = project.in(file(".")).enablePlugins(GatlingPlugin).settings(resolvers ++= Seq(typesafe, typesafeSnapshot), target := baseDirectory.value / s"gatling-${testMode}", libraryDependencies ++= Seq(“io.gatling.highcharts” % “gatling-charts-highcharts” % “2.1.6”, “io.gatling” % “gatling-test-framework” % “2.1.6”))

This gives me an error -

[error] Modules were resolved with conflicting cross-version suffixes in {file:/Users/akasha/workspace/dsp-api-v2/dsp-api/}gatlingTest:
[error] com.typesafe.akka:akka-actor _2.11, _2.10

If I use, I get the following unresolved dependency error -

lazy val test = project.in(file(".")).enablePlugins(GatlingPlugin).settings(resolvers ++= Seq(typesafe, typesafeSnapshot), target := baseDirectory.value / s"gatling-${testMode}", libraryDependencies ++= Seq((“io.gatling.highcharts” %% “gatling-charts-highcharts” % “2.1.6”).exclude(“com.typesafe.akka”, “akka-actor_2.10”), (“io.gatling” %% “gatling-test-framework” % “2.1.6”).exclude(“com.typesafe.akka”, “akka-actor_2.10”)))

sbt.ResolveException: unresolved dependency: io.gatling.highcharts#gatling-charts-highcharts_2.10;2.1.6: not found

What am I missing here ?

Gatling 2.1 requires Scala 2.11, not 2.10.
And then, Play requires AHC 1.8 while Gatling 2.1 requires 1.9.
Either upgrade to Play 2.4 or use Play and Gatling in different projects or modules.

Hi,

  1. You do no specify scalaVersion in your build settings, meaning you’re using the Scala’s version that SBT itself uses, which is 2.10.4. As Stéphane said, Gatling requires Scala 2.11, so you need to set scalaVersion to be at least on a 2.11 version.
  2. Then, in your second example, Gatling is not cross compiled for multiple Scala versions, so use %, not %%. Finally, your exclusion on akka-actor_2.10 is useless, since we don’t use 2.10 dependencies.

And anyway, AHC versions are not compatible. Only Play 2.4 uses AHC 1.9.