Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you debug Maven plugin tests executed with the maven-invoker-plugin?

Tags:

maven

I would like to attach to some tests for a Maven plugin being executed with the maven-invoker-plugin. How does one do this? I can't seem to find any resources and it doesn't seem to be by simply doing:

MAVEN_OPTS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9001" mvn clean install

I mean -- I can connect this way, but when the maven-invoker-plugin starts, it just sits there. Forever...

Any help would be appreciated.

like image 357
carlspring Avatar asked Apr 11 '13 15:04

carlspring


2 Answers

You must be aware that maven-invoker-plugin invokes a separate instance of Maven for running integration tests like a manual call of mvn with the appropriate configuration options. That's the reason why maven sticks...

You can put the appropriate options into invoker.mavenOpts or into a invoker.properties file. An other option would be to change the mavenExecuteable and use mvnDebug instead of mvn.

like image 187
khmarbaise Avatar answered Nov 19 '22 18:11

khmarbaise


Apparently, (after further inspectiong of the build.log) with the above mentioned way, it freezes simply because Maven is waiting for you to connect with a remote debugger a second time -- this time for the forked process.

like image 1
carlspring Avatar answered Nov 19 '22 20:11

carlspring