The Gatling sbt plugin integrates Gatling into your sbt build for projects written in Scala, enabling you to run simulations using standard sbt test tasks, and to package or deploy them to Gatling Enterprise Edition. It provides two configurations —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/gatling/gatling.io-doc/llms.txt
Use this file to discover all available pages before exploring further.
Gatling and GatlingIt — so you can separate fast functional tests from longer integration-style load tests.
Versions
Check available versions on Maven Central. Milestone (M) versions are for Gatling Enterprise Edition customers only.
Setup
Step 1 — Add the Plugin
Add the Gatling sbt plugin toproject/plugins.sbt:
Step 2 — Enable in build.sbt
Enable theGatlingPlugin and add the required library dependencies in build.sbt:
Configurations: Gatling vs. GatlingIt
The plugin provides two sbt configurations that map to different source directories:| Configuration | Source Directory | Report Output | Typical Use |
|---|---|---|---|
Gatling | src/test/scala | target/gatling | Fast tests run alongside unit tests |
GatlingIt | src/it/scala | target/gatling-it | Long-running integration load tests |
Running Simulations
Run all simulations in theGatling configuration:
GatlingIt configuration:
Overriding JVM Options
The plugin uses sensible JVM defaults. To adjust heap settings without replacing the defaults entirely, useoverrideDefaultJavaOptions:
Additional Tasks
The plugin also exposes the following utility tasks:Gatling/startRecorder
Starts the Gatling Recorder, saving results to the path set by
Gatling/scalaSource.Gatling/generateReport
Generates an HTML report for a specified results folder.
Gatling/lastReport
Opens the most recently generated report in your web browser.
Gatling/copyConfigFiles
Copies
gatling.conf and recorder.conf from the bundle into your project resources if absent.Running Simulations on Gatling Enterprise Edition
Prerequisites
You need a Gatling Enterprise Edition API token with the Configure role on the expected teams. Store it using one of:- The
GATLING_ENTERPRISE_API_TOKENenvironment variable - The
gatling.enterprise.apiTokenJava system property
build.sbt:
Deploying to Gatling Enterprise Edition
Create or update packages and simulations automatically:Starting Simulations on Gatling Enterprise Edition
Deploy and start a simulation in a single command:build.sbt:
--run-title <title>— Sets a title for the run report.--run-description <description>— Sets a description for the run summary.
Packaging for Manual Upload
Generate a deployable JAR for manual upload:target/gatling/<artifactId>-gatling-enterprise-<version>.jar. For the GatlingIt configuration:
target/gatling-it/<artifactId>-gatling-enterprise-<version>.jar.
Private Packages
Configure the Control Plane URL for private location deployments inbuild.sbt: