在 IntelliJ 中调试 web app,maven 构建的 webapp,jetty 运行 [英] Debug web app in IntelliJ, webapp built by maven, run by jetty
问题描述
我使用的是 s/o 代码,它是一个由 maven 构建的 java webapp.webapp 由 maven 脚本运行,如下所示,app 运行在 localhost:8080, :
I'm using s/o code, it's a java webapp built by maven. The webapp is run by maven script, like below, and the app is run on localhost:8080, :
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.8.v20121106</version>
<configuration>
<contextPath>/</contextPath>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<!--<port>8085</port>-->
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<stopKey>stop</stopKey>
<stopPort>8089</stopPort>
</configuration>
</plugin>
</plugins>
</build>
我想附上 IntelliJ 的调试器,以便我可以单步调试代码.我尝试设置调试器配置,例如:Jetty Server,然后是Remote",但它说未指定应用程序服务器.我也试过本地",它说不包括主配置文件".
I want to attach the debugger of IntelliJ so that I can step through the code. I tried to set up a debugger configuration like: Jetty Server, then 'Remote' but it said Application Server not specified. I also tried with 'Local', it said 'main config file not included'.
那么我必须怎么做才能附加调试器?提前致谢.
So what must I do to attach the debugger? Thanks in advance.
推荐答案
最简单的方法是:
- 在
Maven 项目
选项卡中扩展您的项目. - 展开
Plugins
>jetty
项目. - 右键单击
jetty:run
. - 从上下文菜单中选择
Debug
.
- Expand your project in the
Maven Projects
tab. - Expand
Plugins
>jetty
items. - Right-click
jetty:run
. - Choose
Debug
from the context menu.
这篇关于在 IntelliJ 中调试 web app,maven 构建的 webapp,jetty 运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!