how to run gatling from command line

3,494 views
Skip to first unread message

Tal Salman

unread,
Feb 5, 2015, 7:30:25 AM2/5/15
to gat...@googlegroups.com
for now, i have a maven project in intellij and i run it by the engine of scala from the ui.
how i need to run it batch.
i saw that i need gatling-maven-plugin.
but my intellij cannot find it.
what is the right way to do it? 

Stéphane LANDELLE

unread,
Feb 5, 2015, 8:01:57 AM2/5/15
to gat...@googlegroups.com
It's in central: http://search.maven.org/#search%7Cga%7C1%7Cgatling-maven-plugin
No idea why your Intellij can't find it.

Stéphane Landelle
Lead developer


--
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.

Ioneyed

unread,
Feb 5, 2015, 8:06:10 AM2/5/15
to gat...@googlegroups.com
With the gatling-maven-plugin you will be able to declare what build phase you want to run test from. However the current gatling-maven-plugin appears to be out of date of gatling 2.1.4 as gatling 2.1.4 doesn't accept the -rbf (request-bodies) argument which causes an error. If you download the Gatling Universal bundle you will get some shell/batch scripts and the root gatling library that will allow you to run the scenarios from the command line.

I hope to have some time today to fork and fix the maven-plugin as we prefer to use this method with jenkins than the jenkins plugin (we save our reports out on a remove server for viewing).

slan...@gatling.io

unread,
Feb 5, 2015, 8:33:29 AM2/5/15
to gat...@googlegroups.com
Check the migration guide and you'll realize the request-bodies folder has been renamed, and so was the option.


--

Ioneyed

unread,
Feb 5, 2015, 8:44:55 AM2/5/15
to gat...@googlegroups.com
My bad, there are 2 gatling-maven plugins (assuming to keep legacy apps running) to which I have the old one installed

post request-bodies rename  (https://github.com/gatling/gatling-maven)

Thanks for the heads up.

Stéphane LANDELLE

unread,
Feb 5, 2015, 10:57:10 AM2/5/15
to gat...@googlegroups.com
The code was copied into a new project where we merge the maven plugin and the maven archetype.

Stéphane Landelle
Lead developer


Tal Salman

unread,
Feb 5, 2015, 11:29:46 AM2/5/15
to gat...@googlegroups.com
so why i cannot find it here: https://plugins.jetbrains.com/search/index?pr=idea_ce&search=gatling-maven-plugin
i would like it to be added automatically. not edit the pom file no?

Stéphane LANDELLE

unread,
Feb 5, 2015, 11:38:41 AM2/5/15
to gat...@googlegroups.com
It's not an IntelliJ plugin, it's a maven one!

 
i would like it to be added automatically. not edit the pom file no?

Of course you have.

Tal Salman

unread,
Feb 8, 2015, 6:50:37 AM2/8/15
to gat...@googlegroups.com
ok, still 2.1.4 is not found when i insert this the plugin into my pom file:
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>${gatling.version}</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<!-- Default values -->
<!--<configFolder>src/test/resources</configFolder-->
<dataFolder>src/test/resources/data</dataFolder>
<resultsFolder>target/results</resultsFolder>
<requestBodiesFolder>src/test/resources/request-bodies</requestBodiesFolder>
<simulationsFolder>src/test/scala</simulationsFolder>
</configuration>
</execution>
</executions>
</plugin>



On Thursday, February 5, 2015 at 2:30:25 PM UTC+2, Tal Salman wrote:

Pierre DAL-PRA

unread,
Feb 8, 2015, 8:12:58 AM2/8/15
to gat...@googlegroups.com
When publishing minor versions of Gatling, we do not publish everything, unless it is really needed (e.g. there has been bugfixes).
Since the Maven Plugin did not need fixes recently, the latest Maven Plugin is 2.1.2 :


Replace 2.1.4 by 2.1.2 for the Maven Plugin and it'll work :)
--

Tal Salman

unread,
Feb 8, 2015, 8:57:58 AM2/8/15
to gat...@googlegroups.com
i must have the 2.1.4 because a fix you did and solved.
but anyway even i change it to 2.1.2 it still says:

[ERROR] No plugin found for prefix 'gatling' in the current project and in the plugin groups [or



On Thursday, February 5, 2015 at 2:30:25 PM UTC+2, Tal Salman wrote:

Tal Salman

unread,
Feb 8, 2015, 8:59:51 AM2/8/15
to gat...@googlegroups.com
i perform the command mvn gatling:execute. is it right?


On Thursday, February 5, 2015 at 2:30:25 PM UTC+2, Tal Salman wrote:

Pierre DAL-PRA

unread,
Feb 8, 2015, 9:11:37 AM2/8/15
to gat...@googlegroups.com




On 8 févr. 2015, at 14:57, Tal Salman <tal.s...@gmail.com> wrote:

i must have the 2.1.4 because a fix you did and solved.

A fix for Gatling itself, quite possibly.
But the Maven Plugin is just a way of running Gatling, and you can have the Maven Plugin v2.1.2 and still use Gatling 2.1.4, since the Maven Plugin does not bundle Gatling.

but anyway even i change it to 2.1.2 it still says:

[ERROR] No plugin found for prefix 'gatling' in the current project and in the plugin groups [or


Can you share your pom.xml please?

On Thursday, February 5, 2015 at 2:30:25 PM UTC+2, Tal Salman wrote:
for now, i have a maven project in intellij and i run it by the engine of scala from the ui.
how i need to run it batch.
i saw that i need gatling-maven-plugin.
but my intellij cannot find it.
what is the right way to do it? 

--

Tal Salman

unread,
Feb 8, 2015, 9:33:00 AM2/8/15
to gat...@googlegroups.com
here is my pom file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gatling</groupId>
<artifactId>gatling</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<scala.version>2.11.4</scala.version>
<encoding>UTF-8</encoding>

<gatling.version>2.1.4</gatling.version>

<scala-maven-plugin.version>3.2.0</scala-maven-plugin.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-app</artifactId>
<version>${gatling.version}</version>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-recorder</artifactId>
<version>${gatling.version}</version>
</dependency>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
<version>${gatling.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
</dependency>


</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-app</artifactId>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-recorder</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
</dependencies>

<build>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<arg>-target:jvm-1.7</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-unchecked</arg>
<arg>-language:implicitConversions</arg>
<arg>-language:postfixOps</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>



On Thursday, February 5, 2015 at 2:30:25 PM UTC+2, Tal Salman wrote:

Tal Salman

unread,
Feb 8, 2015, 9:52:07 AM2/8/15
to gat...@googlegroups.com
sorry, i think i solved it.
i didn't add just this to the pom filein the pluginManagement:
plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
   <version>2.1.2</version>
</plugin>

On Thursday, February 5, 2015 at 2:30:25 PM UTC+2, Tal Salman wrote:

Tal Salman

unread,
Feb 8, 2015, 10:41:58 AM2/8/15
to gat...@googlegroups.com
ok so cli is working now perfect.
what i did:
updated the pom file with:<plugin>
   <groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>2.1.2</version>
</plugin>

in the pluginManagement.
version 2.1.2 and not 2.1.4

adding:
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>2.1.2</version>
   <executions>
<execution>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
            <simulationsFolder>gatling/test/scala</simulationsFolder>
</configuration>
</execution>
</executions>
</plugin>
the simulation folder is according your folder.
and the command is:

mvn test -Dgatling.simulationClass=yoursimulationname



On Thursday, February 5, 2015 at 2:30:25 PM UTC+2, Tal Salman wrote:
Reply all
Reply to author
Forward
0 new messages