Skip to content
Gatling Plugin for Gradle
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper Set the plugin version to 3.0.0 and check the Gatling tool version. (#68 Oct 23, 2018
src Fixes #76: Log failed simulations names correctly Nov 22, 2018
.gitignore Configurable source folders (#42) Sep 6, 2017
.travis.yml build with jdk9 Apr 14, 2018
LICENSE Initial commit Dec 8, 2015
build.gradle Set the plugin version to 3.0.0 and check the Gatling tool version. (#68 Oct 23, 2018 Prepare for releasing version 3.0.2 Nov 26, 2018
gradlew Initial implementation of the Gatling plugin. Dec 8, 2015
nb-actions.xml Added custom publish action for NetBeans. Oct 17, 2016


Gatling Plugin for Gradle


Follow the steps described at Gradle Plugin Portal page.


Plugin versioning

Since Gatling v3.0.0 this plugin’s major version follows Gatling 's major version for making things easier.

Source code layout

Since Gatling v3.0.0 and corresponding plugin version v3.x.x there were breaking changes introduced for source code layout. Check corresponding section for details and original Gatling issue explaining the scope of changes.

Source files layout

The plugin uses src/gatling as its source root. There’re following directories available for putting corresponding files.

Directory Purpose


Simulation sources (Scala code)


Resources (feeders, configuration, bodies, etc)

Plugin configuration

The plugin defines the following extension properties in the gatling closure

Property name Type Default value Description




Gatling version




The default Gatling console log level if no logback.xml present in the configutation folder




Include main source set output to gatlingCompile




Include test source set output to gatlingCompile




scala version that fits your Gatling tool version



['-server', '-Xmx1G',
'-XX:+UseG1GC', '-XX:MaxGCPauseMillis=30',

Additional arguments passed to JVM when executing Gatling simulations


Closure or Iterable<String>

{ include "**/*Simulation*.scala" }

Simulations filter.
If closure then See Gradle docs for details, otherwise an Iterable of simulations fully qualified names.


Overriding Gatling version and JVM arguments
gatling {
    toolVersion = '3.0.0'
    jvmArgs = [ '-server', '-Xms512M', '-Xmx512M' ]
Filtering simulations using FQN list
gatling {
    simulations = [ 'com.package1.MySimu', 'com.package2.advanced.MySimulation' ] (1)
  1. only execute com.package1.MySimu and com.package2.advanced.MySimulation simulations.

Filtering simulations using Groovy closure
gatling {
    simulations = {
        include "**/package1/*Simu.scala"    (1)
        include "**/package2/*Simulation.scala"  (2)
  1. all Scala files from plugin simulation dir subfolder package1 ending with Simu.

  2. all Scala files from plugin simulation dir subfolder package2 ending with Simulation.

Gatling configuration

Override gatling.conf

To override default parameters of Gatling just put own version of gatling.conf into src/gatling/resources.


Gatling uses logback to customize its output. To change logging behaviour, put your logback.xml into resources folder, src/gatling/resources.

If no custom logback.xml provided, by default plugin will implicitly use following configuration.

<?xml version="1.0" encoding="UTF-8"?>
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
  <root level="${logLevel}"> (1)
    <appender-ref ref="CONSOLE"/>
  1. logLevel is configured via plugin extension, WARN by default.

Dependency management

This plugin defines three configurations gatling, gatlingCompile and gatlingRuntime. By default plugin adds Gatling libraries to gatling configuration. Configurations gatlingCompile and gatlingRuntime extend gatling, i.e. all dependencies declared in gatling will be inherited.

Also project classes (src/main) and tests classes (src/test) are added to gatlingCompile and gatlingRuntime classpath, so you can reuse existing production and test code in your simulations.

If you don’t need such behaviour, you can use flags:

gatling {
    // do not include classes and resources from src/main
    includeMainOutput = false
    // do not include classes and resources from src/test
    includeTestOutput = false

Additional dependencies can be added by plugin’s users to any of configurations mentioned above.

dependencies {
    gatling '' (1)
    gatlingCompile 'org.apache.commons:commons-lang3:3.4' (2)
    gatlingRuntime 'cglib:cglib-nodep:3.2.0' (3)
  1. adding gson library, available both in compile and runtime classpath.

  2. adding commons-lang3 to compile classpath for simulations.

  3. adding cglib to runtime classpath for simulations.


Plugin provides dedicated task GatlingRunTask that is responsible for execute gatling simulations. Customer may create instances of this task to execue particular simulations. Task extends Gradle 's JavaExec task.

Default tasks

Additionally plugin creates several default tasks

Task name Type Description



Compiles Gatling simulation and copies resources



Executes all Gatling simulations configured by extension



Executes single Gatling simulation,
SimulationFQN should be replaced by fully qualified simulation class name.


Run all simulations
$ gradle gatlingRun
Run single simulation implemented in com.project.simu.MySimulation class
$ gradle gatlingRun-com.project.simu.MySimulation

Troubleshooting and known issues

Spring Boot and Netty version

Caused by io.spring.dependency-management plugin and Spring platform BOM files. The dependency management plugin ensures that all declared dependencies have exactly the same versions as declared in BOM. Since Spring Boot declares own Netty version (e.g. 4.1.22.Final) - this version is applied globally for all the configurations of the Gradle project, even if configuration doesn’t use Spring.

There’s 2 ways of solving the problem, depending on the actual usage of Netty in the project

  • When production code doesn’t rely on Netty

ext['netty.version'] = '4.0.51.Final'

This declares Netty version globally for all transitive dependencies in your project, including Spring.

  • When production code uses Netty

dependencyManagement {
    gatling {
        dependencies {
            dependencySet(group: 'io.netty', version: '4.0.51.Final') {
               entry 'netty-codec-http'
               entry 'netty-codec'
               entry 'netty-handler'
               entry 'netty-buffer'
               entry 'netty-transport'
               entry 'netty-common'
               entry 'netty-transport-native-epoll'

This options ensures that 4.0.51.Final will be used only for gatling configurations, leaving other dependencies unchanged.

You can’t perform that action at this time.