I have a Servlet-based application (OAuth implementation) which delegates some of the response rendering to JSP, as in the following example:
private void do
It turns out that by default Maven's Surefire plugin employs a trick wherein it creates a Manifest-Only JAR file, in order to avoid the need to pass the full classpath to the forked JRE (see this article). The Jetty JSP processor simply asks each classloader for its list of URLs, and so only sees the one manifest-only JAR file, rather than all the JAR files that are actually being used, and hence doesn't find the TLD files.
The simple solution, which is also documented on that page, is to turn off the useManifestOnlyJar
option, as follows:
org.apache.maven.plugins
maven-surefire-plugin
2.18.1
false
....
This instructs Surefire to directly pass the full classpath to the forked JRE process, thereby allowing it to locate the TLDs.