How to choose scala version that gatling use ?

Hi.

I want to use gatling maven plugin 2.1.7 for my project.
I read this to add gatling in maven :
http://gatling.io/docs/2.1.7/extensions/maven_plugin.html?highlight=plugin

When I run gatling:execute I have this error :

`
[INFO] — gatling-maven-plugin:2.1.7:execute (default) @ zenith-portal-webui —
Downloading: http://zenith-sf/nexus/content/groups/public/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar
Downloading: http://zenith-sf/nexus/content/groups/public/com/typesafe/zinc/zinc/0.3.5.3/zinc-0.3.5.3.jar
Downloaded: http://zenith-sf/nexus/content/groups/public/com/typesafe/zinc/zinc/0.3.5.3/zinc-0.3.5.3.jar (384 KB at 495.6 KB/sec)
Downloaded: http://zenith-sf/nexus/content/groups/public/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar (6960 KB at 762.6 KB/sec)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:26)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:147)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:142)
at sbt.IO$.withTemporaryDirectory(IO.scala:285)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:142)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:139)
at sbt.IO$.withTemporaryDirectory(IO.scala:285)
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:139)
at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:33)
at com.typesafe.zinc.Compiler$.compilerInterface(Compiler.scala:148)
at com.typesafe.zinc.Compiler$.create(Compiler.scala:53)
at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:115)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at io.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:35)
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)
… 6 more
Caused by: java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
at scala.reflect.io.AbstractFile.(AbstractFile.scala:91)
at scala.reflect.io.PlainFile.(PlainFile.scala:34)
at scala.reflect.io.AbstractFile$.getDirectory(AbstractFile.scala:47)
at scala.reflect.io.AbstractFile$.getDirectory(AbstractFile.scala:36)
at scala.tools.nsc.settings.MutableSettings$OutputDirs.setSingleOutput(MutableSettings.scala:270)
at scala.tools.nsc.settings.MutableSettings$OutputSetting.value_$eq(MutableSettings.scala:545)
at scala.tools.nsc.settings.MutableSettings$OutputSetting.(MutableSettings.scala:542)
at scala.tools.nsc.settings.MutableSettings.OutputSetting(MutableSettings.scala:221)
at scala.tools.nsc.settings.ScalaSettings$class.$init$(ScalaSettings.scala:64)
at scala.tools.nsc.settings.MutableSettings.(MutableSettings.scala:19)
at scala.tools.nsc.Settings.(Settings.scala:12)
at scala.tools.nsc.Driver.process(Driver.scala:39)
at scala.tools.nsc.Main.process(Main.scala)
… 31 more
Caused by: java.lang.ClassNotFoundException: scala.collection.GenTraversableOnce$class
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 44 more

`

I read on some topics that galting 2.1.X need scala 2.11.X.
I don’t understand why it automatically download scala 2.10 on the nexus while version 2.11.7 is on our nexus.

How can I choose the version of scala that gatling will use ?

I can see the sbt compiler in that stacktrace which needs Scala 2.10.x If set Gatling should compile on 2.11.x

Please have a look at the demo project: http://github.com/gatling/gatling-maven-plugin-demo

Gatling is built on Scala 2.11, but the compiler itself runs on Scala 2.10.

I download the example project and I have the same error when I run “mvn gatling:execute -Dgatling.simulationClass=computerdatabase.BasicSimulation”.

I delete all the dependencies to keep only gatling-charts-highcharts and now it works.
I think there was a conlict between some dependencies.

The demo’s only dependency is gatling-highcharts.
I suspect you had conflicting versions of gatling or scala-library.