What is a good way in maven/surefire to clean up after unit tests, whether they pass or not?

青春壹個敷衍的年華 提交于 2019-12-04 15:02:53

You should bound the thing you want to do into the post-integration-test lifecycle phase which is running afterwards the integration-test phase which is handled by the maven-failsafe-plugin. It might work if you configure the maven-clean-plugin to do so.

I would make sure the files are created in either target/ or the OS's temporary directory (using System.getProperty("java.io.tmpdir"). Then they will be cleaned up automatically when you run mvn clean, or eventually by the OS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!