# Debugging through Maven (IntelliJ IDEA) does not work

**URL:** <https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754>\
**Category:** Gatling (Open-Source)\
**Created:** [August 26, 2025, 12:32pm UTC](https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754 "2025-08-26T12:32:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![omair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/omair/32/1662_2.png) [@omair](https://community.gatling.io/u/omair)\
**Post date:** [August 26, 2025, 12:32pm UTC](https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754/1 "2025-08-26T12:32:09Z")

</div>

**Gatling version** :  
**Gatling flavor** : java  
**Gatling build tool** : maven

I followed [the directions](https://docs.gatling.io/guides/optimize-scripts/debugging/#maven-with-intellij-idea) to set up a run configuration in IntelliJ:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/7/7cd9df9984ce6f4f4a337618990a80462dc8b07d.png)

The VM option –add-opens=java.base/java.lang=ALL-UNNAMED does not work at all. If I run the Maven configuration with this setting I get the following error:

```auto
/bin/sh /Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/mvn -Didea.version=2025.2 -Dmaven.ext.class.path=/Applications/IntelliJIDEA.app/Contents/plugins/maven/lib/maven-event-listener.jar -Djansi.passthrough=true -Dstyle.color=always --add-opens=java.base/java.lang=ALL-UNNAMED gatling:test -Dgatling.sameProcess=trueUnable to parse command line options: Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED

```

```auto
usage: mvn [options] [<goal(s)>] [<phase(s)>]

```

If I remove that VM option, I can run my Gatling test, but the debugger does not stop at my breakpoints at all. Can I get help in how to get this working?

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [August 26, 2025, 1:07pm UTC](https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754/2 "2025-08-26T13:07:47Z")

</div>

~~Regarding `Unable to parse command line options: Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED`, I can only think of 2 possible sane explanations:~~

1. ~~your `temurin-21` is actually NOT Java 21 =\> verify the Java installation it points to~~
2. ~~you have some non printable character in your input =\> clean the “Run“ and “VM options“ input fields and fill them again manually, character by character~~

> I can run my Gatling test, but the debugger does not stop at my breakpoints at all

Make sure you use up-to-date Gatling and gatling-maven-plugin versions.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [August 26, 2025, 1:42pm UTC](https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754/3 "2025-08-26T13:42:20Z")

</div>

> `Unable to parse command line options: Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED

It’s a regression in IntelliJ IDEA 2025.2. `VM options` are currently broken, see [https://youtrack.jetbrains.com/projects/IDEA/issues/IDEA-377059/Maven-vm-options-not-recognized-correctly](https://youtrack.jetbrains.com/projects/IDEA/issues/IDEA-377059/Maven-vm-options-not-recognized-correctly).

---

<div class="post-metadata">

**Author:** ![omair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/omair/32/1662_2.png) [@omair](https://community.gatling.io/u/omair)\
**Post date:** [August 26, 2025, 1:43pm UTC](https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754/4 "2025-08-26T13:43:12Z")

</div>

I can confirm that updating my pom.xml to use the [pom from the Java example project](https://github.com/gatling/gatling-maven-plugin-demo-java/blob/main/pom.xml) (which among other things upgrade Gatling to the latest version) fixes the issue with the debugger.

I’m seeing breakpoints being hit during scenario setup:

 ![CleanShot 2025-08-26 at 09.45.18](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/9/9c78ff5ef2a8ec1782b3e353c4dba54b6747f393.png)

However, when I actually try to run the scenario (the setUp function), I get the following exception:

```auto
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:4.20.1:test (default-cli) on project publisher-perf-tests: Gatling failed.: InvocationTargetException: module java.base does not open java.lang to unnamed module @2d683b2d -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Disconnected from the target VM, address: '127.0.0.1:57164', transport: 'socket'

```

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [August 26, 2025, 8:13pm UTC](https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754/5 "2025-08-26T20:13:32Z")

</div>

@omair Please read my previous messages about the IntelliJ IDEA bug. You NEED this VM option.  
If you want to make things work, you must either restore a previous version of IDEA, or wait for the fix.

---

<div class="post-metadata">

**Author:** ![omair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/omair/32/1662_2.png) [@omair](https://community.gatling.io/u/omair)\
**Post date:** [August 26, 2025, 8:42pm UTC](https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754/6 "2025-08-26T20:42:08Z")

</div>

I can confirm that after

- downgrading to IntelliJ IDEA Ultimate 2025.1.4.1 and
- adding the VM option `--add-opens=java.base/java.lang=ALL-UNNAMED`to the run configuration

I am able to set fully functioning breakpoints within the scenario script.

Thanks @slandelle !

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [September 25, 2025, 8:42pm UTC](https://community.gatling.io/t/debugging-through-maven-intellij-idea-does-not-work/9754/7 "2025-09-25T20:42:50Z")

</div>

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