SBT has a good hook that allows you to execute arbitrary code after running all the tests:
testOptions in Test += Tests.Cleanup( () => println("Cleanup"))
It works. My question is: I want to do some actual cleanup (for example, stopping some services), but I cannot import any dependencies that I declared in the same assembly file. Is there any way to do this? I think I need to put them in the sbt class path or something else, but I can not find it in the docs.
PS Maybe I'm doing it in the wrong place, is there a better place to stop working after all the tests?)
source share