Embedded Jetty TLD resolution in Maven integration tests
By default, the maven-failsafe-plugin
executes in the system classloader, which prevents Jetty to locate the TLDs referred to in web.xml
.
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<jetty.port>${allocated.jetty.port}</jetty.port>
</systemPropertyVariables>
<!-- This is needed so that the embedded Jetty's JSP parser can find the .tld
files for the JSTL namespaces -->
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
<executions>
<execution>
<id>failsafe</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
Note that this applies when running embedded Jetty (a la fat-jar), not when bootstraping Jetty from its Maven plug-in.
Written by David Dossot
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Maven
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#