Is there a way to tell tomcat to keep specific files under a exploded WAR file's directory?

let's say I have the following folder that I've created after the WAR has been deployed:


Everytime I deploy the WAR it is deleted. Is there a way to keep this directory and its files?

| improve this question | | | | |

According to the Tomcat 6.0 deployment howto, the exploded webapp "is removed, and the .WAR is expanded again". So the whole /webapps/myApp/ directory gets deleted upon deployment. There is no way to keep the files in it.

If you want to keep the uploaded files, you should define a directory outside your webapp dir, and use that from within the web application.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.