I have a webapp that uses JNDI to locate a datasource and a transaction manager. I see from the Jetty documentation how to do this via the jetty-env.xml file. However it mentions that this file should be put into the WEB-INF directory.
Why would they suggest that JNDI resources be configured in a configuration file that is located inside my WAR? It makes no sense…I always thought of JNDI as a way to externalize configuration. Is there another place I can put this file on a Jetty server machine?
A follow up question: How about within my Maven WAR module…how should I deal with this file so that I can use the Maven jetty plugin for development, but not have the file end up in the WAR?
The official JNDI page puts it like this:
Use
jetty.xmlto configure things “outside” the webapp.Use the jettyConfig parameter of the Maven Jetty Plugin: