I am building a webapp through Gradle's war plugin. In order to disable Tomcat's session persistence, I need to place the file context.xml
in the META-INF
directory of the war's root.
I attempted the following:
src/main/webapp/META-INF/context.xml
of the main projectsrc/main/resources/META-INF/context.xml
of the main projectHowever, when I build the project using gradle clean war
, the produced war file contains a META-INF
with only a MANIFEST.MF
in it. It is as if my directory gets overridden.
How do I place context.xml
in the war?
src/main/webapp/META-INF/context.xml
is correct and works fine for me. Chances are that you went wrong somewhere, or that there is a problem with your build script.