How to debug a maven goal with intellij idea?
Very easy. I am using Intellj Idea 15.0.4
- Set the breakpoint in your maven plugin
- In the tag "Maven Projects" go to the project witch is using your maven plugin.
- In "Plugins" find your plugin and over the goal right click and Debug
Here is a screenshot:
Figured it out:
- 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 JVM Debug
Configuration.- Under Settings, set Transport: Socket, Debugger Mode: Attach, Host: localhost, Port: 8000 (default port of mvnDebug).
- Run the Configuration in Debug mode. It should connect to the waiting mvnDebug jvm.