1

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:

/webapps/myApp/uploads

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

Native
  • 55
  • 8

1 Answers1

4

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.

StackzOfZtuff
  • 1,754
  • 12
  • 21
Lacek
  • 6,585
  • 22
  • 28