debugging - 在IntelliJ中调试Web应用程序,由Maven构建,由Jetty运行

标签 debugging web-applications intellij-idea jetty maven-jetty-plugin

我正在使用S / O代码,这是由Maven构建的Java WebApp。该webapp由maven脚本运行,如下所示,该应用程序在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”,但它表示未指定Application Server。我也尝试使用“本地”,它说“不包括主配置文件”。

那么我该怎么做才能连接调试器?
提前致谢。

最佳答案

最简单的方法是:

  • Maven Projects选项卡中扩展项目。
  • 展开Plugins> jetty项目。
  • 右键单击jetty:run
  • 从上下文菜单中选择Debug

  • screen shot of "Maven Projects" panel, context-menu to run Jetty in debug mode

    关于debugging - 在IntelliJ中调试Web应用程序,由Maven构建,由Jetty运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15111366/

    相关文章:

    java - 客户端-服务器系统中的客户端故障检测(分布式)

    java - 在条件代号一上显示表单

    xml - TestNG 不会输出任何包含失败测试的 xml

    c++ - 登录 C++(性能考虑)

    linux - 您如何诊断内核 oops?

    ios - Xcode错误: Failed to set () user defined inspected property: this class is not key value coding-compliant for the key

    web-applications - 从 Web 应用程序访问本地文件

    web-services - GWT 富 Internet 应用程序 (RIA) 和 REST HATEOAS - 它们的兼容性如何?

    php - 如何将 XML 字符串回显到 HTML 页面以进行调试?

    android - 测试通过 maven 和 adb 运行,而不是 IntelliJ - 为什么?