JiboOne
JiboOne

Reputation: 1548

prevent tomcat 7 from deleting my custom context file on every single overwrite/undeploy of my webapp

I have a web application deployed on tomcat 7. Its context file, named myAppName.xml is located in $CATALINA_HOME/conf/Catalina/localhost folder.

The problem I'm facing is that on each overwrite or undeploy, my configuration file is deleted from $CATALINA_HOME/conf/Catalina/localhost folder and I have to copy/paste it from a backup location.

How can I prevent this behavior? I don't want to copy/paste context file everytime I change something in webapp.

Upvotes: 13

Views: 3891

Answers (1)

user207421
user207421

Reputation: 310893

Put it into web/META-INF in the source tree, then Tomcat will copy it out of there into conf/.... on each deploy. Tomcat 7 won't even do that by default, just use it where it is.

Upvotes: 1

Related Questions