The key is the gatling configuration that generally is placed in gradle.build
:
gatling {
// WARNING: options below only work when logback config file isn't provided
logLevel = 'WARN' // logback root level
logHttp = 'NONE' // set to 'ALL' for all HTTP traffic in TRACE, 'FAILURES' for failed HTTP traffic in DEBUG
enterprise {
// Enterprise Cloud (https://cloud.gatling.io/) configuration reference: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/#working-with-gatling-enterprise-cloud
// Enterprise Self-Hosted configuration reference: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/#working-with-gatling-enterprise-self-hosted
}
}
It is a default Gatling configuration to which you must refer when using Play's Framework Readme snippet, like this:
dependencies {
gatling 'com.google.code.gson:gson:2.8.0'
gatlingImplementation 'org.apache.commons:commons-lang3:3.4'
gatlingRuntimeOnly 'cglib:cglib-nodep:3.2.0'
}
So, in order to include the dependencies, you need to prepend gatling
to the code provided in the Play Readme.
Here's my working gradle.build
file:
plugins {
id 'scala'
id 'io.gatling.gradle' version '3.8.3.2'
}
gatling {
logLevel = 'WARN' // logback root level
logHttp = 'NONE' // set to 'ALL' for all HTTP traffic in TRACE, 'FAILURES' for failed HTTP traffic in DEBUG
}
repositories {
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/com.typesafe.play/play-json
gatlingImplementation group: 'com.typesafe.play', name: 'play-json_2.13', version: '2.9.2'
}