简体   繁体   English

防止tomcat 7在我的webapp的每次覆盖/取消部署时删除我的自定义上下文文件

[英]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. 我在tomcat 7上部署了一个Web应用程序。它的上下文文件myAppName.xml位于$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. 我面临的问题是,每次覆盖或取消部署时,我的配置文件都会从$CATALINA_HOME/conf/Catalina/localhost文件夹中删除,我必须从备份位置复制/粘贴它。

How can I prevent this behavior? 我该如何防止这种行为? I don't want to copy/paste context file everytime I change something in webapp. 每次我在webapp中更改内容时,我都不想复制/粘贴上下文文件。

Put it into web/META-INF in the source tree, then Tomcat will copy it out of there into conf/.... on each deploy. 将它放入源代码树中的web / META-INF,然后Tomcat将其复制到每个部署的conf / .... Tomcat 7 won't even do that by default, just use it where it is. 默认情况下,Tomcat 7甚至不会这样做,只需使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM