I have a background daemon ./debugger
that I need to start before all surefire tests and kill after all of them completed or failed. The daemon can save its pid to pidfile provided by command line argument, so I can start it with ./debugger --pid=debugger.pid
and stop with kill -TERM $(cat debugger.pid)
.
Is it possible to configure maven in pom.xml
to start this daemon before tests and stop after that?
If your tests need pre and post processing, it would be more suitable to run them in the integration test phase. You can use the failsafe plugin for that
https://maven.apache.org/surefire/maven-failsafe-plugin/index.html