如何在使用GAE Maven插件时在IDEA中调试Java Google App Engine应用程序? [英] How can I debug a Java Google App Engine app in IDEA while using the GAE Maven plugin?

查看:120
本文介绍了如何在使用GAE Maven插件时在IDEA中调试Java Google App Engine应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经像 那样设置了我的pom.xml,并且它似乎是工作的大部分,我可以启动devserver和更新应用程序。

我的问题是,我似乎无法调试devserver。我试图在IDEA中以调试模式启动devserver maven目标,但是当我设置断点时,它们被忽略。



我在GAE Maven插件文档中发现可以启动在调试模式下使用以下配置的devserver:

 < jvmFlags> 
< jvmFlag> -Xdebug< / jvmFlag>
< jvmFlag> -agentlib:jdwp = transport = dt_socket,address = 8000,server = y,suspend = n
< / jvmFlags>

然而,我不知道如何告诉IDEA连接调试器,当我启动Maven Run /调试配置。



任何人都可以指出我正确的方向吗?

解决方案

在你的问题中提到的配置看起来不错。所以,你有:

< jvmFlags>
< jvmFlag> -Xdebug< / jvmFlag>
< jvmFlag> -agentlib:jdwp = transport = dt_socket,address = 8000,server = y,suspend = n
< / jvmFlags>




  1. 当您运行Maven构建版本

      mvn appengine:devserver 



    <在某些时候它暂停并等待远程调试器连接。在IDEA中,转到运行>

  2. 编辑配置... 并添加新的远程配置。


  3. 给它一个名称和检查参数

  4. 点击确定
  5. >
  6. Run>运行调试器。调试'<您的配置名称>' Shift-F9


I have set up my pom.xml like so, and it appears to be working for the most part, I can start the devserver and update the application.

My problem is that I can't seem to debug the devserver. I tried launching the devserver maven goal in debug mode from within IDEA, but when I set breakpoints they are ignored.

I found in the GAE Maven plugin docs that you can launch the devserver in debug mode with the following configuration:

<jvmFlags>
  <jvmFlag>-Xdebug</jvmFlag>
  <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
</jvmFlags>

However I don't know how to tell IDEA to connect the debugger when I start the Maven Run/Debug configuration.

Can anyone point me in the right direction?

解决方案

The configuration mentioned in your question looks good. So, you have:

<jvmFlags>
  <jvmFlag>-Xdebug</jvmFlag>
  <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
</jvmFlags>

  1. When you run your Maven build

    mvn appengine:devserver
    

    at some point it halts and waits for the remote debugger to connect.

  2. In IDEA, go to Run > Edit Configurations... and add a new Remote configuration.

  3. Give it a name and check parameters (especially the port).
  4. Click OK
  5. Run the debugger with Run > Debug '<name of your config>' (Shift-F9)

这篇关于如何在使用GAE Maven插件时在IDEA中调试Java Google App Engine应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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