Not able to build Gatling Maven project in Intellij

Am getting below error while building the sample maven project

D:\gatling-maven-plugin-demo-main\src\test\scala\Engine.scala
object gatling is not a member of package io
import io.gatling.app.Gatling

Hi @senthilkumarmani,

Welcome aboard!

I just tried now to compile, and everything is fine.

My steps:

git clone git@github.com:gatling/gatling-maven-plugin-demo-scala.git
cd gatling-maven-plugin-demo
mvn compile

My information:

$ java -version
openjdk version "17.0.8.1" 2023-08-24
OpenJDK Runtime Environment (build 17.0.8.1+1)
OpenJDK 64-Bit Server VM (build 17.0.8.1+1, mixed mode)
$ mvn -version
Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
Maven home: /opt/maven
Java version: 17.0.8.1, vendor: N/A, runtime: /usr/lib/jvm/java-17-openjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.5.5-arch1-1", arch: "amd64", family: "unix"

I’m not on Windows, but such error is not relative to OS.

What were your steps? What is your java version? Your maven version?
Do you compile from maven or from your IDE? Which one?

Cheers!

Hi @sbrevet ,

Am new to Gatling as well as performance testing
I tried to compile the maven project using IntelliJ IDE

Below are the version details
OS : Windows , version : Windows 10 Pro
java version “12.0.2”
JDK 12.0.2+10

Thanks

If you’re a new beginner, I really recommend that you go with Gatling Java instead of Gatling Scala as it will work out of the box with IntelliJ while Scala requires some extra steps.

Note: there’s a bug in IntelliJ’s scala-maven-plugin support. I’ve just reported it: https://youtrack.jetbrains.com/issue/SCL-21701/scala-maven-plugin-based-projects-shouldnt-require-the-scalaVersion-config-option-to-be-defined-in-order-to-be-properly-imported

In the meantime, I’ve updated the sample project and added some boilerplate to make it work: chore: force scalaVersion option so IntelliJ figures it out · gatling/gatling-maven-plugin-demo-scala@e62d326 · GitHub

Sure let me try with Gatling Java. Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.