Debugging in maven with mvnDebug command

后端 未结 2 1108
萌比男神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
    
    0 讨论(0)
  • 2021-01-13 03:36

    I changed @set MAVEN_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

    to

    @set MAVEN_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%MAVEN_DEBUG_PORT%

    in mvnDebug.cmd then either set MAVEN_DEBUG_PORT in env variables or locally with set @set MAVEN_DEBUG_OPTS=8001 before you call mvnDebug xxx:run (I'm using Jetty)

    0 讨论(0)
提交回复
热议问题