Passing JVM arguments via maven plugin version 2.1

3,028 views
Skip to first unread message

Daniel Moll

unread,
Dec 19, 2014, 3:48:39 AM12/19/14
to gat...@googlegroups.com
Hi Guys,

In my Gatling tests setup I use Maven profiles for executing different test types, by passing load characteristics to my script via JVM arguments in the pom.xml, for example:

<profile>
<id>stresstest</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>com.klm.gatling</groupId>
<artifactId>gatling-klm</artifactId>
</dependency>
</dependencies>
<properties>
<profile-id>stresstest</profile-id>
</properties>
<build>
<plugins>
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<configuration>
<dataFolder>src/test/resources/data</dataFolder>
<resultsFolder>target/gatling/results</resultsFolder>
<requestBodiesFolder>src/test/resources/request-bodies</requestBodiesFolder>
<simulationsFolder>src/test/scala</simulationsFolder>
<noReports>true</noReports>
<!--<reportsOnly>false</reportsOnly>-->
<simulationClass>com.klm.gatling.BrightIdeas</simulationClass>
<jvmArgs>
<jvmArg>-DstartRampUpUsersPerSec=${startRampUpLoad}</jvmArg>
<jvmArg>-DconstantUsersPerSec=${stressTestLoad}</jvmArg>
<jvmArg>-DrampUpPeriodSeconds=${stressTestRampUpDuration}</jvmArg>
<jvmArg>-DconstantUsersPerSecDuringSeconds=${stressTestDuration}</jvmArg>
<jvmArg>-Xms2g</jvmArg>
<jvmArg>-Xmx5g</jvmArg>
</jvmArgs>
<!--<fork>true</fork>-->
<propagateSystemProperties>true</propagateSystemProperties>
<!--<failOnError>true</failOnError>-->
</configuration>
</plugin>
</plugins>
</build>
</profile>

Experimenting with Gatling version 2.1 I found this setup is not working anymore. I figured it has to do something with the fact Gatling doesn't compile the simulations anymore like described in https://github.com/gatling/gatling/blob/master/src/sphinx/project/migration_guides/2.0-to-2.1.rst. Unfortunately I lack the Maven knowledge to solve this without some help. Could someone please point me in the right direction? Much appreciated!

Cheers

Daniel

Stéphane Landelle

unread,
Dec 19, 2014, 4:02:42 AM12/19/14
to gat...@googlegroups.com
Hi Daniel,

Do you use the version 2.1.1 of the maven plugin too?

Cheers,

Stéphane


Daniel

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pierre DAL-PRA

unread,
Dec 19, 2014, 4:05:10 AM12/19/14
to gat...@googlegroups.com
Hi Daniel,

This has nothing to do with the fact that Gatling doesn't compile the simulation itself anymore, since system properties are runtime parameters and not compile time parameters.

However, it can be a regression introduced by the major refactorings the Maven Plugin went under in 2.1.

I'll investigate.

Cheers,

Pierre

Stéphane Landelle

unread,
Dec 19, 2014, 4:08:20 AM12/19/14
to gat...@googlegroups.com
OK, I get it. Another missing stuff in the migration guide.

gatling-maven-plugin 2.1.X no longer has a jvmArgs configuration argument. It now has:
  • zincJvmArgs that controls the JVM that compiles (you're not really supposed to touch this, but who knows)
  • gatlingJvmArgs that controls the JVM that runs
Set gatlingJvmArgs instead of jvmArgs.

@pdalpra: I think we should rename gatlingJvmArgs into jvmArgs ASAP. WDYT?

Daniel Moll

unread,
Dec 19, 2014, 4:56:53 AM12/19/14
to gat...@googlegroups.com
Renaming jvmArg did the trick, thanks for you reply!

Cheers

Daniel

Stéphane Landelle

unread,
Dec 19, 2014, 4:58:55 AM12/19/14
to gat...@googlegroups.com
We'll revert to jvmArgs in upcoming 2.1.2: https://github.com/gatling/gatling/issues/2460

Thanks for reporting!

Cheers,
Stéphane


Cheers

Daniel

Reply all
Reply to author
Forward
0 new messages