Earlier this week I had a great deal of difficulty reverting the project properties that Clover changes when it runs (so that it wouldn't interfere with subsequent plugins):
How to revert Maven project.build variables after Clover plugin finishes?
I solved this issue by saving these properties when Maven starts up and using the saved variables in my plugins instead of the ones which Clover alters.
Now that I'm able to host the non-instrumented WAR file in the pre-integration-test phase my tests are able to run successfully and pass (previously, I was unable to run the app from the instrumented WAR file since Clover was not on the release class path).
Unfortunately, I'm finding that the forked Clover life cycle continues beyond the test phase. After my tests pass and the embedded Tomcat instance shuts down the original lifecycle runs the Tomcat7 plugin again, starts the server, and re-runs the test.
I can live with it running my unit tests twice (this can catch edge case bugs which only appear with or without Clover instrumentation), but running my integration tests twice is entirely unnecessary. These tests don't touch the production code (they're using Selenium to automate UI testing against it in the browser). As mentioned, the instrumented WAR file was not working anyway, so it's no longer even there when the integration tests are run. There is absolutely no reason that these tests need to be run again.
How can I tell Clover to terminate the forked lifecycle after the test phase completes so that the integration tests will only run once? I'm currently only able to enable it for the entire lifecycle or not at all.
Update: I've found that even if I disable the Clover plugin by passing in -Dmaven.clover.skip=true that it will still fork the lifecycle. The only way I've found to prevent this is to comment out the Clover plugin entirely so that it does not have a chance to fork the lifecycle before skipping instrumentation.