如何使用IntelliJ IDEA调试Maven目标? [英] How to debug a maven goal with intellij idea?

查看:331
本文介绍了如何使用IntelliJ IDEA调试Maven目标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以使用Intellij IDEA调试Maven目标吗?我知道我可以右键单击并运行 Debug .但是,该maven插件未出现在我的外部库列表中,因此无法进入代码并设置断点.因此, Debug 会像 Run 一样不停地运行目标.

Can you debug a maven goal with Intellij IDEA? I know that I can right-click and run Debug. However, the maven plugin does not appear in my External Libraries list, so I can not go into the code and set a breakpoint. Thus, Debug runs through the goals without stopping, like Run does.

我正在使用OS X 10.8和IDEA 12.0.2.

I am using OS X 10.8 and IDEA 12.0.2.

目标

我已经为 https://github.com/searls/jasmine-maven编写了自定义specRunner -plugin -但是,$ specs $保持为空.因此,我尝试查看实际加载了哪些文件.

I've written custom specRunner for https://github.com/searls/jasmine-maven-plugin - However, $specs$ stays empty. So I try to see which files are actually loaded.

推荐答案

弄清楚了:

    从命令行
  1. ,使用mvnDebug而不是mvn运行maven目标.例如. mvnDebug clean
  2. 在intelliJ中打开要调试的Maven插件的源代码并设置一个BreakPoint
  3. 在IDEA中,添加Remote配置.
  1. from the command line, run maven goal with mvnDebug instead of mvn. E.g. mvnDebug clean
  2. Open the source of the maven plugin you want to debug in intelliJ and set a breakPoint
  3. In IDEA, add a Remote Configuration.
  1. 在设置下,设置传输:套接字,调试器模式:附加,主机:本地主机,端口:8000(mvnDebug的默认端口).

  • 以调试"模式运行配置.它应该连接到正在等待的mvnDebug jvm.
  • 这篇关于如何使用IntelliJ IDEA调试Maven目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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