speed up (e.g.) mvn jetty:run by disabling annotation scanning on jetty startup

When your app gets large and you don’t use annotation based configuration, to improve its’ startup time, you can do the following:

1. add metadata-complete=”true” to your web.xml header:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
   metadata-complete="true">

2. add absolute-ordering inside the file.

   <absolute-ordering/>
</web-app>
Advertisements