Tomcat Documentation (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html)
Only if the context file does not exist for the application in $ CATALINA_BASE / conf / [enginename] / [hostname] /, in a separate file on / META -INF / context.xml inside the application files. If the application website is packaged as WAR, then / META -INF / context.xml will be copied to $ CATALINA_BASE / conf / [enginename] / [hostname] / and renamed to match the application context path. Once this file exists, it should not be replaced if the new WAR with the new / META -INF / context.xml is placed in the host application database.
The text is in bold. But I am notifying you as a lie. (I need just this behavior)
Here are the steps:
- aaa.war with context.xml included in META-INF
- copy to webapps. tomcat deployment.
conf\Catalina\localhost\aaa.xmlOK file - modify aaa.war by changing META-INF / context.xml
- copy to webapps
- File
conf\Catalina\localhost\aaa.xmlmodified !!!
What's wrong? Is this a bug or a hidden function?
Background is the problem I want to solve:
Configuration and assembly. I sit down to send a war file. The client configures his Tomcat with his own settings. when I submit a new release, I will just deliver the war without configuration, and when deployed, it will use client-specific configuration.
According to the documentation, the best place is context.xml. But if it is overwritten every time, then it makes no sense to use it at all. (why should I use JNDI and such things if I need to create a new result? Changing something during the build is not a big configuration advantage.)
: windows, tomcat 6.0.33