I'm working on adding integration tests to an existing java web application which makes use of Spring and Jersey. Many of our other services are packaged as WARs, but this is packaged as a JAR with all dependencies. In said other services, we use Cargo to start them during Maven's pre-integration-test phase and to stop them during post-integration-test.
So the problem is getting the server started for our integration tests. We can use the exec plugin to start the service, but since it never exits the integration tests aren't run. We can also extend JerseyTest, which will successfully start the server, but it starts and stops it for every single test, which would take up a lot of time.
So is there any way for me to configure JerseyTest to start the service only once? Or otherwise is there a way for me to start and stop the JAR without resorting to platform-dependent scripts?