Debugging in maven with mvnDebug command

后端 未结 2 1107
萌比男神i
萌比男神i 2021-01-13 03:06

I read this: Debugging in Maven?

I\'m running intellij remote debug and maven for a service I\'m trying to debug.

I\'m running

mvnDebug tom         


        
2条回答
  •  北海茫月
    2021-01-13 03:27

    Wow, Maven makes this difficult. Setting -Xrunjdwp in MAVEN_OPTS won't work, because mvnDebug.bat adds its own afterward, which will override MAVEN_OPTS. I would copy mvnDebug.bat to myMvnDebug.bat and comment out the line set MAVEN_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000. That way you can set MAVEN_DEBUG_OPT on the command line before running it.

    C:\somewhere>set MAVEN_DEBUG_OPT=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001
    C:\somewhere>myMvnDebug.bat
    

提交回复
热议问题