How to auto clear Tomcat temp directory on server startup through maven

I want to delete all the files and subdirectories from the temp folder of Tomcat 8+ version.

In my application ActiveMQ is integrated which will create one folder inside temp folder of Tomcat on the server startup. So I want to clear my temp folder before creating another folder by ActiveMQ on server startup.

Is there any way to define any maven plugin to achieve this or there is any other way to get this done?



Read more here: https://stackoverflow.com/questions/66273447/how-to-auto-clear-tomcat-temp-directory-on-server-startup-through-maven

Content Attribution

This content was originally published by user3552342 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: