In Apache Tomcat 9, the JNDI Resources How-To page has a section at the bottom, Adding Custom Resource Factories.
To write a class that implements the JNDI service provider javax.naming.spi.ObjectFactory
interface, the doc says:
You will need to compile this class against a class path that includes all of the JAR files in the $CATALINA_HOME/lib directory.
That lib
folder contains:
websocket-api.jar
tomcat-jni.jar
tomcat-util-scan.jar
tomcat-util.jar
tomcat-websocket.jar
tomcat-i18n-pt-BR.jar
tomcat-i18n-ru.jar
tomcat-i18n-zh-CN.jar
tomcat-jdbc.jar
tomcat-i18n-ja.jar
tomcat-i18n-ko.jar
tomcat-i18n-cs.jar
tomcat-i18n-de.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
jaspic-api.jar
jsp-api.jar
servlet-api.jar
tomcat-api.jar
tomcat-coyote.jar
tomcat-dbcp.jar
el-api.jar
jasper-el.jar
jasper.jar
catalina-tribes.jar
catalina.jar
ecj-4.12.jar
catalina-ha.jar
catalina-storeconfig.jar
annotations-api.jar
catalina-ant.jar
➥ How do I satisfy this requirement in a Maven-driven project?
I certainly do not want all those jars bundled into the resulting WAR file of my web app.