0

我是 Gradle 的新手。我在 Eclipse 中使用 Buildship。我的 build.gradle 看起来像,

gretty {
    httpPort = 8080
    contextPath = '/'
    servletContainer = 'jetty9'
}

当我将应用程序调试为“gretty -> appStartDebug”时,控制台会等待说,

Listening for transport dt_socket at address: 5005

我的项目是一个带有 init 的 Web 应用程序,

@WebServlet(urlPatterns="/InitServlet", loadOnStartup=0)
public class InitServlet extends HttpServlet {
}

public static void initialize() {
 system.out.println("Initializing");
}

我在 sysout 中有我的断点。这是调试gradle应用程序的正确方法吗?

4

1 回答 1

0

控制台正在等待您的调试器进程附加到套接字。

  1. 在 Eclipse 中创建一个新的远程调试会话
  2. 执行 gradle 任务appStartDebug并等待消息:

    Listening for transport dt_socket at address: 5005

  3. 在 Eclipse 中运行您之前配置的远程调试配置

  4. 停止使用 gradle 任务调试您的 Web 应用程序appStop

在此处阅读以了解更多信息以及如何在 IntelliJ IDEA 中进行调试。

于 2018-04-16T11:27:07.677 回答