Gatling Maven throws exception if given -Dgatling.simulation

I checked out the gatling maven demo project and run the gatling:execute goal with gatling.simulation argument, but get the following exception. Did I do anything wrong?

mvn gatling:execute -Dgatling.simulation=basic.BasicExampleSimulation
[INFO] Scanning for projects…
[INFO] ------------------------------------------------------------------------
[INFO] Building gatling-maven-plugin-demo 1.4.5
[INFO] ------------------------------------------------------------------------
[INFO] — gatling-maven-plugin:1.4.5:execute (default-cli) @ gatling-maven-plug
in-demo —
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
at java.lang.reflect.Method.invoke(
at scala_maven_executions.MainHelper.runMain(
at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.jav
Caused by: com.typesafe.config.ConfigException$WrongType: system properties: gat
ling.simulation has type STRING rather than OBJECT
at com.typesafe.config.impl.SimpleConfig.findKey(
at com.typesafe.config.impl.SimpleConfig.find(
at com.typesafe.config.impl.SimpleConfig.find(
at com.typesafe.config.impl.SimpleConfig.find(
at com.typesafe.config.impl.SimpleConfig.find(
at com.typesafe.config.impl.SimpleConfig.getString(
at com.excilys.ebi.gatling.core.config.GatlingConfiguration$.setUp(Gatli
… 6 more
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.856s
[INFO] Finished at: Sat Mar 23 04:42:16 PDT 2013
[INFO] Final Memory: 6M/184M
[INFO] ------------------------------------------------------------------------

Funny one.
That’s a naming conflict.

Here’s what happens:

  • you’re passing -Dgatling.simulation in order to configure the target simulation from the command line instead of setting up statically in the pom.xml (perfect use case)
  • the gatling maven plugin default behavior is fork + propagateSystemProperties, so the system property gatling.simulation is propagated to the forked JVM that will run Gatling
  • the configuration framework let one override the configuration file with System properties, the problem is that it expects gatling.simulation to be an Object (see gatling.conf file) and not a String
    I guess the only proper solution is to change/translate the gatling-maven-plugin properties so that they can never conflict with the main engine ones.

As a workaround, you can:

  • disable propagateSystemProperties, see However, depending on your use case, you might need to propagate them.
  • don’t set up directly maven plugin gatling.simulation property, but its value. I think something like this might work (haven’t tested, please let me know:
    mvn gatling:execute -Dfoo=basic.BasicExampleSimulation



Thanks for prompt reply. I will definitely give it a try and let you
know :). It's 5 AM here now, so I will defer the task until later.


Good night, then! :slight_smile:


actually works :slight_smile:

Glad to hear, thanks for your feedback.

We’ve had to rename the property from “simulation” to “simulationClass” in 1.4.6 in order to avoid the clash.
Be aware of this when upgrading.