Posts

Showing posts from April, 2013

Upgrading maven-jetty-plugin for Jetty 8 to use Servlet 3.0

When moving from Jetty 6 to Jetty 8, one of the biggest changes is the jump from Servlet version 2.5 to version 3.0. There is also a change in the JSP version which was 2.0 in Jetty 6.x while it is JSP 2.1 in Jetty 8.x. Keeping that in mind, the dependency for the servlet api needs to be configured to use Servlet 3.0 jars. This should have been sufficient if it wasn't for a change in "maven-jetty-plugin" also. Up to versions 6.x of the maven-jetty-plugin are available under the artifactId of "maven-jetty-plugin". So running, mvn jetty:run with the following in your pom.xml would be sufficient. <plugin>   <groupId>org.mortbay.jetty</groupId>   <artifactId>maven-jetty-plugin</artifactId> </plugin> But if you try to do that with Servlet 3.0, you would end up with a java.lang.ClassNotFoundException for javax.servlet.ServletRegistration$Dynamic.class This is because for jetty 7 and above, the artifactId for the plugin is "jet...