Search code examples
tomcatclojureleiningenring

How to add META-INF/context.xml in lein-ring uberwar


When generating an uberwar with lein-ring, I'm able to add resources to the class path using the :resource-paths key in the root of my project.clj. Any resources added this way appear under /WEB-INF/classes/

Due to legacy reasons, I need to provide a context.xml under META-INF at the root of the .war file (interpreted as a zip).

How can I do this?


Solution

  • For these sorts of purposes, lein-ring provides a :war-resources-path (optionally :war-resource-paths) key to be set at the root of your project.clj.

    Any files under the directory (or directories) specified as such, will be copied directly into your .war file.

    As such, place a folder in your project (I used /war-root) that contains META-INF/context.xml as you expect it to be.