Setting debug configuration for maven+jetty+eclipse

二次信任 提交于 2019-12-02 17:41:56
Kapil Raju

Set MAVEN_OPTS using -

export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

Then start jetty using -

mvn jetty:run

Start remote debugging from your fav IDE on port 8000

Here's a quick workaround. I was battling with this problem also and after a while I achieved a lazy solution.

I use Eclipse Indigo with m2eclipse. I created a new Run Configuration: Right-Clicked the project in Project Explorer -> Run As... -> maven build. Then I defined the necessary maven commands/goals to run the project with jetty straight from Eclipse.

Finally I just ran the newly created configuration in Debug mode and got debug working. This probably messes up something else(?) but works as a quick workaround.

Vishal Goyal

As suggested by h3xstream in one of the comments, you can run using mvnDebug jetty:run.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!