Debug maven scala project

Skip to first unread message

Wei Wang

Sep 4, 2013, 3:59:45 AM9/4/13
Hi all,

I want to debug a maven scala project on a linux server. I googled for a while, the most discussed debugging option for maven project is remote debug. I tried the following command:

$ export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=2293,server=y,suspend=n"
$ mvn scala:run

Listening for transport dt_socket at address: 2293
[INFO] Scanning for projects...
[INFO]  ..............

But it didn't stop to wait for connection from my local IDEA debugger.
Can anyone give me some advice on it?

BTW, is there any way to debug the maven scala project using command line?


David Bernard

Sep 4, 2013, 4:13:32 AM9/4/13
to Maven and Scala

Compilation, run,... are done on a forked process (by default) that ignore MAVEN_OPTS.
You can try to add <JvmArgs> into your pom.xml under a <launcher> configuration for debug, as is no need to remember cli options for futur use. (you can have a regular launcher and a debug launcher)

see :

You received this message because you are subscribed to the Google Groups "Maven and Scala" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

David Bernard

Sep 4, 2013, 4:17:48 AM9/4/13
to Maven and Scala
something like :

          <!-- args are optional -->

mvn scala:run -Dlauncher=debug


Mar 24, 2017, 6:03:42 PM3/24/17
to Maven and Scala
Hi, David,I see this is an old thread, but I just found it. So I am setting the above parameters in jvmArgs but Maven is still not pausing for me but brushing right past it. I get a message in console Listening for transport dt_socket at address: 5005 but then it just goes on and runs the program without waiting for me to connect. Any ideas?
Reply all
Reply to author
0 new messages