在 IntelliJ 中调试 web app,maven 构建的 webapp,jetty 运行 [英] Debug web app in IntelliJ, webapp built by maven, run by jetty

查看:23
本文介绍了在 IntelliJ 中调试 web app,maven 构建的 webapp,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.

推荐答案

最简单的方法是:

  1. Maven 项目 选项卡中扩展您的项目.
  2. 展开Plugins > jetty 项目.
  3. 右键单击jetty:run.
  4. 从上下文菜单中选择 Debug.
  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.

这篇关于在 IntelliJ 中调试 web app,maven 构建的 webapp,jetty 运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆