如何使用IntelliJ IDEA调试Maven目标? [英] How to debug a maven goal with intellij idea?
问题描述
您可以使用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.
推荐答案
弄清楚了:
-
从命令行
- ,使用
mvnDebug
而不是mvn
运行maven目标.例如.mvnDebug clean
- 在intelliJ中打开要调试的Maven插件的源代码并设置一个BreakPoint
- 在IDEA中,添加
Remote
配置.
- from the command line, run maven goal with
mvnDebug
instead ofmvn
. E.g.mvnDebug clean
- Open the source of the maven plugin you want to debug in intelliJ and set a breakPoint
- In IDEA, add a
Remote
Configuration.
- 在设置下,设置传输:套接字,调试器模式:附加,主机:本地主机,端口:8000(mvnDebug的默认端口).
这篇关于如何使用IntelliJ IDEA调试Maven目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!