Debug web app in IntelliJ, webapp built by maven, run by jetty

萝らか妹 提交于 2019-12-02 16:15:34
Kkkev

The easiest way is to:

  1. Expand your project in the Maven Projects tab.
  2. Expand Plugins > jetty items.
  3. Right-click jetty:run.
  4. Choose Debug from the context menu.

I know it's too late to reply this question, but It's worth sharing the latest update on this issue as a modern solution: You can also run jetty using “mvnDebug jetty:run” which has the same effect. Which display the following logs in the terminal

Preparing to Execute Maven in Debug Mode
Listening for transport dt_socket at address: 8000
[INFO] Scanning for projects...

Just remember to choose the correct socket address(e.g. 8000), then:

  1. Open Intellij
  2. Run -> Edit Configuration
  3. In Run/Debug Configuration window, you need to click on (+) button to add a new configuration
  4. Select Remote
  5. Keep the default configuration as is, just change the listening port to corresponding one (8000).

Enjoy.

When I was getting "main config file not included" it was because the path to Jetty in my Application Server configuration (on Run/Debug Configurations dialog) was deleted during my OS X upgrade (I had put it in /usr/share/java).

I reinstalled jetty-hightide-8.1.5.v20120716 under /usr/local, updated the configuration and all is well.

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