Error configuring gatling-sbt using enablePlugins(GatlingPlugin)

Hi all,

NB: Total scala & gatling noob with first time post after much googling.

I’m using sbt 0.13.6 on OS X, trying to follow the instructions in the readme at https://github.com/gatling/gatling-sbt

Here’s my build.sbt:

enablePlugins(GatlingPlugin)

name := "solution-360-payment-flow-client"

version := "0.1"

scalaVersion := "2.11.2"

scalacOptions := Seq("-unchecked", “-deprecation”, “-encoding”, “utf8”)

libraryDependencies ++= {
val akkaV = "2.3.6"
val sprayV = "1.3.2"
Seq(
"io.spray" %% “spray-json” % “1.3.1”,
"io.spray" %% “spray-client” % sprayV,
"io.spray" %% “spray-can” % sprayV,
"io.spray" %% “spray-routing” % sprayV,
"io.spray" %% “spray-testkit” % sprayV % “test”,
"io.spray" %% “spray-caching” % sprayV,
"com.typesafe.akka" %% “akka-actor” % akkaV,
"com.typesafe.akka" %% “akka-testkit” % akkaV % “test”,
"org.specs2" %% “specs2-core” % “2.3.11” % “test”,
"io.gatling.highcharts" % “gatling-charts-highcharts” % “2.1.1” % “test,it”,
"io.gatling" % “gatling-test-framework” % “2.1.1” % "test,it"
)
}

EclipseKeys.withSource := true

And my project/plugins.sbt:

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

addSbtPlugin(“com.typesafe.sbteclipse” % “sbteclipse-plugin” % “2.5.0”)

Here’s my terminal output when trying to run sbt in the root directory of my project (sanitized with ellipses to protect the innocent & highlighting added). My ~/.sbt/0.13/plugins/plugins.sbt is empty.

:beer: scala -version

Scala code runner version 2.11.4 – Copyright 2002-2013, LAMP/EPFL

:beer: sbt --version

sbt launcher version 0.13.6

:beer: sbt

[info] Loading global plugins from /Users/matthew/.sbt/0.13/plugins

[info] Loading project definition from /Users/matthew/Documents/…/lesson-360-exercises/payment-flow-client/solution/project

[info] Updating {file:/Users/matthew/Documents/…/lesson-360-exercises/payment-flow-client/solution/project/}solution-build…

[info] Resolving org.fusesource.jansi#jansi;1.4 …

[info] Done updating.

/Users/matthew/Documents/…/lesson-360-exercises/payment-flow-client/solution/build.sbt:1: error: not found: value enablePlugins

enablePlugins(GatlingPlugin)

^

[error] Type error in expression

Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

What am I doing wrong?

TIA,

Matthew

Have you tried upgrading to 0.13.7?

emoji_u1f37a.png

Upgraded after your question, retried and got the same error. :frowning:

emoji_u1f37a.png

That’s very strange, since this is working without issues : https://github.com/gatling/gatling-sbt/blob/master/src/sbt-test/gatling-sbt/copyConfigFiles/build.sbt
Can you clean your Ivy cache and try again please ?

I renamed ~/.ivy2 to ~/.ivy2-stale and reran, confirming sbt was at version 0.13.7. Same error. :frowning: Here’s terminal output:

:beer: mv ~/.ivy2 ~/.ivy2-stale
:beer: sbt --version
sbt launcher version 0.13.7
:beer: sbt
[info] Loading global plugins from /Users/matthew/.sbt/0.13/plugins
[info] Updating {file:/Users/matthew/.sbt/0.13/plugins/}global-plugins…
[info] Resolving org.fusesource.jansi#jansi;1.4 …
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.10.4!scala-library.jar (3297ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.5/jars/sbt.jar
[info] [SUCCESSFUL ] org.scala-sbt#sbt;0.13.5!sbt.jar (480ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.5/jars/main.jar
[info] [SUCCESSFUL ] org.scala-sbt#main;0.13.5!main.jar (2542ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.5/jars/compiler-interface-src.jar
[info] [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.5!compiler-interface-src.jar (362ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.5/jars/compiler-interface-bin.jar
[info] [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.5!compiler-interface-bin.jar (522ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_8_2/0.13.5/jars/compiler-interface-bin.jar
[info] [SUCCESSFUL ] org.scala-sbt#precompiled-2_8_2;0.13.5!compiler-interface-bin.jar (466ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_2/0.13.5/jars/compiler-interface-bin.jar
[info] [SUCCESSFUL ] org.scala-sbt#precompiled-2_9_2;0.13.5!compiler-interface-bin.jar (470ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_3/0.13.5/jars/compiler-interface-bin.jar
[info] [SUCCESSFUL ] org.scala-sbt#precompiled-2_9_3;0.13.5!compiler-interface-bin.jar (476ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/actions/0.13.5/jars/actions.jar
[info] [SUCCESSFUL ] org.scala-sbt#actions;0.13.5!actions.jar (601ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main-settings/0.13.5/jars/main-settings.jar
[info] [SUCCESSFUL ] org.scala-sbt#main-settings;0.13.5!main-settings.jar (609ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/interface/0.13.5/jars/interface.jar
[info] [SUCCESSFUL ] org.scala-sbt#interface;0.13.5!interface.jar (346ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/io/0.13.5/jars/io.jar
[info] [SUCCESSFUL ] org.scala-sbt#io;0.13.5!io.jar (429ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/ivy/0.13.5/jars/ivy.jar
[info] [SUCCESSFUL ] org.scala-sbt#ivy;0.13.5!ivy.jar (552ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/launcher-interface/0.13.5/jars/launcher-interface.jar
[info] [SUCCESSFUL ] org.scala-sbt#launcher-interface;0.13.5!launcher-interface.jar (359ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logging/0.13.5/jars/logging.jar
[info] [SUCCESSFUL ] org.scala-sbt#logging;0.13.5!logging.jar (349ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logic/0.13.5/jars/logic.jar
[info] [SUCCESSFUL ] org.scala-sbt#logic;0.13.5!logic.jar (361ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/process/0.13.5/jars/process.jar
[info] [SUCCESSFUL ] org.scala-sbt#process;0.13.5!process.jar (351ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/run/0.13.5/jars/run.jar
[info] [SUCCESSFUL ] org.scala-sbt#run;0.13.5!run.jar (349ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/command/0.13.5/jars/command.jar
[info] [SUCCESSFUL ] org.scala-sbt#command;0.13.5!command.jar (412ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classpath/0.13.5/jars/classpath.jar
[info] [SUCCESSFUL ] org.scala-sbt#classpath;0.13.5!classpath.jar (352ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/completion/0.13.5/jars/completion.jar
[info] [SUCCESSFUL ] org.scala-sbt#completion;0.13.5!completion.jar (491ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/api/0.13.5/jars/api.jar
[info] [SUCCESSFUL ] org.scala-sbt#api;0.13.5!api.jar (415ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-integration/0.13.5/jars/compiler-integration.jar
[info] [SUCCESSFUL ] org.scala-sbt#compiler-integration;0.13.5!compiler-integration.jar (349ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-ivy-integration/0.13.5/jars/compiler-ivy-integration.jar
[info] [SUCCESSFUL ] org.scala-sbt#compiler-ivy-integration;0.13.5!compiler-ivy-integration.jar (354ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/relation/0.13.5/jars/relation.jar
[info] [SUCCESSFUL ] org.scala-sbt#relation;0.13.5!relation.jar (342ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/task-system/0.13.5/jars/task-system.jar
[info] [SUCCESSFUL ] org.scala-sbt#task-system;0.13.5!task-system.jar (358ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tasks/0.13.5/jars/tasks.jar
[info] [SUCCESSFUL ] org.scala-sbt#tasks;0.13.5!tasks.jar (361ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tracking/0.13.5/jars/tracking.jar
[info] [SUCCESSFUL ] org.scala-sbt#tracking;0.13.5!tracking.jar (363ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/testing/0.13.5/jars/testing.jar
[info] [SUCCESSFUL ] org.scala-sbt#testing;0.13.5!testing.jar (485ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.4/scala-compiler-2.10.4.jar
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.4!scala-compiler.jar (8207ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.4/scala-reflect-2.10.4.jar
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.4!scala-reflect.jar (1021ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/control/0.13.5/jars/control.jar
[info] [SUCCESSFUL ] org.scala-sbt#control;0.13.5!control.jar (442ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/collections/0.13.5/jars/collections.jar
[info] [SUCCESSFUL ] org.scala-sbt#collections;0.13.5!collections.jar (826ms)
[info] downloading http://repo1.maven.org/maven2/jline/jline/2.11/jline-2.11.jar
[info] [SUCCESSFUL ] jline#jline;2.11!jline.jar (358ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/incremental-compiler/0.13.5/jars/incremental-compiler.jar
[info] [SUCCESSFUL ] org.scala-sbt#incremental-compiler;0.13.5!incremental-compiler.jar (840ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compile/0.13.5/jars/compile.jar
[info] [SUCCESSFUL ] org.scala-sbt#compile;0.13.5!compile.jar (427ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/persist/0.13.5/jars/persist.jar
[info] [SUCCESSFUL ] org.scala-sbt#persist;0.13.5!persist.jar (487ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classfile/0.13.5/jars/classfile.jar
[info] [SUCCESSFUL ] org.scala-sbt#classfile;0.13.5!classfile.jar (417ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbinary/sbinary_2.10/0.4.2/jars/sbinary_2.10.jar
[info] [SUCCESSFUL ] org.scala-tools.sbinary#sbinary_2.10;0.4.2!sbinary_2.10.jar (468ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cross/0.13.5/jars/cross.jar
[info] [SUCCESSFUL ] org.scala-sbt#cross;0.13.5!cross.jar (355ms)
[info] downloading http://repo1.maven.org/maven2/org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar
[info] [SUCCESSFUL ] org.apache.ivy#ivy;2.3.0!ivy.jar (702ms)
[info] downloading http://repo1.maven.org/maven2/com/jcraft/jsch/0.1.46/jsch-0.1.46.jar
[info] [SUCCESSFUL ] com.jcraft#jsch;0.1.46!jsch.jar (414ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cache/0.13.5/jars/cache.jar
[info] [SUCCESSFUL ] org.scala-sbt#cache;0.13.5!cache.jar (609ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/test-agent/0.13.5/jars/test-agent.jar
[info] [SUCCESSFUL ] org.scala-sbt#test-agent;0.13.5!test-agent.jar (355ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar
[info] [SUCCESSFUL ] org.scala-sbt#test-interface;1.0!test-interface.jar (347ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/apply-macro/0.13.5/jars/apply-macro.jar
[info] [SUCCESSFUL ] org.scala-sbt#apply-macro;0.13.5!apply-macro.jar (529ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/jline/2.10.4/jline-2.10.4.jar
[info] [SUCCESSFUL ] org.scala-lang#jline;2.10.4!jline.jar (356ms)
[info] downloading http://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.4/jansi-1.4.jar
[info] [SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (349ms)
[info] Done updating.
[info] Loading project definition from /Users/matthew/Documents/SciSpike/Scala-2-Course-PP/lesson-360-exercises/payment-flow-client/solution/project
[info] Updating {file:/Users/matthew/Documents/SciSpike/Scala-2-Course-PP/lesson-360-exercises/payment-flow-client/solution/project/}solution-build…
[info] Resolving org.fusesource.jansi#jansi;1.4 …
[info] downloading http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/io.gatling/gatling-sbt/scala_2.10/sbt_0.13/2.1.0/jars/gatling-sbt.jar
[info] [SUCCESSFUL ] io.gatling#gatling-sbt;2.1.0!gatling-sbt.jar (1324ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.10/sbt_0.13/2.5.0/jars/sbteclipse-plugin.jar
[info] [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-plugin;2.5.0!sbteclipse-plugin.jar (380ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbteclipse/sbteclipse-core/scala_2.10/sbt_0.13/2.5.0/jars/sbteclipse-core.jar
[info] [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-core;2.5.0!sbteclipse-core.jar (745ms)
[info] downloading http://repo1.maven.org/maven2/org/scalaz/scalaz-core_2.10/7.0.2/scalaz-core_2.10-7.0.2.jar
[info] [SUCCESSFUL ] org.scalaz#scalaz-core_2.10;7.0.2!scalaz-core_2.10.jar(bundle) (2425ms)
[info] downloading http://repo1.maven.org/maven2/org/scalaz/scalaz-effect_2.10/7.0.2/scalaz-effect_2.10-7.0.2.jar
[info] [SUCCESSFUL ] org.scalaz#scalaz-effect_2.10;7.0.2!scalaz-effect_2.10.jar(bundle) (472ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.1/scala-library-2.10.1.jar
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.10.1!scala-library.jar (2094ms)
[info] Done updating.
/Users/matthew/Documents/…/lesson-360-exercises/payment-flow-client/solution/build.sbt:4: error: not found: value enablePlugins
enablePlugins(GatlingPlugin)
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

Do you have a build.properties in the project/ folder which fixes the SBT version (e.g. sbt.version=0.13.7) ?
My guess is that in that case, SBT not being absolutely sure of the 0.13.x version that will be used, may not allow AutoPlugins (since they were introduced with 0.13.2 IIRC).

Always setting the build.properties file is a very good pratice :wink:
And it’s actually enforceable if you happen to use Paul Philips SBT script : https://github.com/paulp/sbt-extras.
Since it deduces the SBT version to use from this file, you’re sure to never forget to create it :wink: