maven3, gatling-maven-plugin and the -s option

Hi, great tool. Thanks for putting this out there.

I am trying to configure our TeamCity install to run our Gatling tests. I have the plugin installed, POM attached but I keep getting errors regarding the Simulation class to be run, if I use the -s option

com.excilys.ebi.gatling:gatling-maven-plugin:1.4.5:execute -e -X -s * mvn3 interprets this a pointer to a config file?

OS name: “linux”, version: “3.8.0-29-generic”, arch: “amd64”, family: “unix”
[INFO] Error stacktraces are turned on.
[ERROR] Error executing Maven.
java.io.FileNotFoundException: The specified user settings file does not exist: /home/alan/tmp/stable31/gatling/*

If I omit it the -s it tells me to specify a class:

[ERROR] Failed to execute goal com.excilys.ebi.gatling:gatling-maven-plugin:1.4.5:execute (default-cli) on project gatling: Gatling failed. More than 1 simulation to run, need to specify one → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.excilys.ebi.gatling:gatling-maven-plugin:1.4.5:execute (default-cli) on project gatling: Gatling failed.

The -s option worked with Maven2 - odd…

thanks,
Alan

pom.xml (4.55 KB)

Actually, I’m using 2.0.0.M3

io.gatling:gatling-maven-plugin:2.0.0-M3:execute

Could you provide the exact stacktrace you get with Gatling 2M3, please?

Cheers,

Stéphane

Hi Stéphane - wow, speedy reply!

Attached both with and without -s flag

Thanks,
Alan

mvnout_with_minusS_option.txt (2.31 KB)

mvnout_no_minusS_option.txt (153 KB)

Since maven 3, maven can take a -s option for forcing an alternate settings file. We didn’t realize that, so we’ll have to change this shortcut.

Since you have multiple simulations in your classpath, you have to tell the gatling-maven-plugin which one to launch.
There’s a configuration option for that: simulationClass: https://github.com/excilys/gatling/wiki/Maven-plugin#wiki-advanced

You should be able to pass it with the full name: -Dgatling.simulationClass=XXX

Cheers,

Stéphane

Actually, I thing -Ds=XXX should work to (and was the proper way for what you were trying)

I tried the -Ds=* but that reverted to the same warning about multiple simulations.

I realise I can specify a particular simulation, however I was using the plugin to work around the issue of only running a single simulation, and was hoping that all .scala’s checked into my project could be run - other than this I have to get the Dev team to manually edit the POM each time - this will remove me from all Christmas present lists :wink:

Many thanks,
Al

io.gatling:gatling-maven-plugin:2.0.0-M3:execute -e -X -Ds=*

[DEBUG] effective simulationsFolder: /home/alan/tmp/stable31/gatling/src/test/scala
[DEBUG] resolved simulation classes: [fkp.pac.SelectContract, fkp.pac.SelectContractA]
[ERROR] More than 1 simulation to run, need to specify one
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.720s
[INFO] Finished at: Tue Sep 03 14:13:50 IST 2013
[INFO] Final Memory: 6M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.0.0-M3:execute (default-cli) on project gatling: Gatling failed. More than 1 simulation to run, need to specify one → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.gatling:gatling-maven-plugin:2.0.0-M3:execute (default-cli) on project gatling: Gatling failed.

Mmm, I thought this would work… Will have to check when I find time.

Anyway, what works for sure is:

${gatling.simulationClass}

mvn … -Dgatling.simulationClass:foo.Bar

Then, your Xmas presents should be safe :wink:

No prob Stéphane,

Thanks for your help, I might check out the plugin src and have a look around.

Al