how to add gatling gradle plugin with scalaVersion extension

Hi,

My project written in kotlin and gradle build file written in kotlin DSL

My build file look like below
loadtesting.gradle.kts

plugins {
id( “io.gatling.gradle”) version “3.5.0”
}

when i build it says

A problem occurred configuring project ‘:loadtesting’.
> Could not resolve all dependencies for configuration ‘:loadtesting:detachedConfiguration1’.
> Conflict(s) found for the following module(s):
- org.scala-lang:scala-library between versions 2.13.3, 2.13.0, 2.13.2 and 2.13.1
- com.typesafe:config between versions 1.4.1 and 1.4.0
- org.scala-lang:scala-reflect between versions 2.13.3 and 2.13.0
Run with:
–scan or
:loadtesting:dependencyInsight --configuration detachedConfiguration1 --dependency org.scala-lang:scala-library
to get more insight on how to solve the conflict.

Could someone guild me how to pass scala version to kotlin gradle build file (not groovy)

Thanks in advance
Ravi G

Unresolved dependencies usually means a network issue when trying to download artifacts from maven central.
If you’re in a corporate network where you’re required to go through a proxy, make sure to confirm it.
If you’re required to use an internal repository such as Nexus or Artifactory, make sure to configure it.

i found the cause of the issue and adding it here so that it can helpful for others. in my build file it has

dependencyManagement {
resolutionStrategy {
failOnVersionConflict()
}

}

gatling plugin finds multiple scala versions and resolutionStrategy throws above error.

Regards
RaviG

Such check is completely overkill and doesn’t work in practice as transitive dependencies can perfectly pull different yet compatible versions.