How to debug maven plugin

I found out that new maven 3.0.5 is broken (http://youtrack.jetbrains.com/issue/IDEA-121292), I would like to fix it since it seriously affects me.

My question is, how to debug it? It runs in a separate process. I would expect to see some switch to make it run without it, but I found none.

0
2 comments
Avatar
Permanently deleted user

Hi,

I'm not 100% sure but I think the maven integration may use the external builder API. If so you can try this:

  1. In your development IJ launch you locally compiled version of IJ with the -Dcompiler.process.debug.port=<port-number> system property set.
  2. In your development IJ define a "remote" debug/run debug configuration which connect to the port you have chosen in 1)
  3. put the desired breakpoints
  4. Now in the "sandbox" IJ trigger the maven plugin
    1. it may start but nothing will happen: the external builder plugin (its JVM) waits for de remote debug connnection
    2. Go to your development IJ (i.e. not sandbox one) start the remote debugging


As I said I'm not postive it will work for the maven plugin. What I described is how it works for me for my external plugin development

See http://confluence.jetbrains.com/display/IDEADEV/External+Builder+API+and+Plugins for more info

Hope it can help.

Johan

0

Thanks, it got me on the right track, and I found a system property "idea.maven.embedder.debug.port" which does the trick you described.

0

Please sign in to leave a comment.