I am new to Gatling (2.1.2) and want to do a small prototype project to show to my colleagues.
According to the quick start page, there are several ways I can run a
I had a similar issue, I fixed it as following:
Inside Gatling package there is bin/
and take a look at gatling.sh
. You see that it simply adds certain configurations into classpath and then runs io.gatling.app.Gatling
class in gatling-compiler-
. So, all you need to do is to make a jar that includes compiler, add configurations and tests to classpath and run io.gatling.app.Gatling
.
steps:
add compiler dependency:
io.gatling
gatling-compiler
${gatling.version}
create jar with dependencies:
org.apache.maven.plugins
maven-assembly-plugin
2.4.1
jar-with-dependencies
${project.build.finalName}
package
single
create test jar (this includes your gatling tests)
org.apache.maven.plugins
maven-jar-plugin
2.4
test-jar
src/test/resources/*
${project.build.finalName}
create a package out of your configuration. You can use maven assembly for that. What I usually do, is to create a separate module that handles creating the package for different environments. This package contains your gatling.conf
, logback.xml
and all the other resources you application wants including test data.
Now you basically have three packages: application.jar
, application-tests.jar
and application-conf.zip
.
Unzip application-conf.zip
, copy application.jar
and application-tests.jar
in the same folder.
In this folder, You need to create target/test-classes/
folder, just
leave it empty. In my case, it was required. I think you can some how
change that in gatling.conf
. But I am not sure how.
Run
java -cp ".:application-test.jar:application.jar" io.gatling.app.Gatling