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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With