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

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

  1. Hey, we have been struggling to speed up our jetty:run process. Not it runs in about 7 seconds, instead of the initial 59 seconds. Big THANKS!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s