tomcatwarmeta-inf

How to modify Tomcat's default META-INF\context.xml?


(Tomcat discussed here is an in-Liferay embedded 7.0.42.)

For WARs that come with no META-INF\context.xml Tomcat supplies its own. Hence whenever I re-deploy such app this file also gets (re)written. Unfortunately the default version of META-INF/context.xml does not suit my (debugging) needs.

Where does Tomcat store the default version of META-INF\context.xml?

Possibly an alternate solution?
I also tried to place my own context.xml here, so Tomcat does not supply its own:

%TOMCAT%\conf\Catalina\localhost\mywebapp.xml

...without any apparent effect; context.xml in webapps\my-web-app\META-INF\context.xml still gets (over)written with Tomcat's own.

(Modifying the WAR itself is not desirable.)


Solution

  • This is how one can supply one's own context.xml ad-hoc, during the build (i.e. w/o modifying the sources) and thus avoid Tomcat adding its own:
    mvn install ... -Dmaven.war.containerConfigXML=src/main/resources/context.xml