title: What is taking long on Jetty startup?
body: <p>Starting Jetty there's a long delay (8s) before my web application starts loading</p>
  
  <pre><code>13:50:10 [INFO] jetty-9.4.5.v20170502
  13:50:18 [INFO] Scanning elapsed time=146ms
  </code></pre>
  
  <p>With debug logging turned on there are two interesting steps</p>
  
  <ul>
  <li><p>Extracting dependent war-application, which takes time after all (3s)</p>
  
  <pre><code>10:03:13 [DEBUG] Extracting entry = null from jar file:[..]/application-1.0.war
  10:03:16 [DEBUG] Unpacked overlay: jar:file:[..]/application-1.0.war!/ to file:[..]
  </code></pre></li>
  <li><p>and the below 4s delay:</p>
  
  <pre><code>10:03:16 [DEBUG] Service loaders found in 0ms
  10:03:20 [DEBUG] loaded interface javax.servlet.ServletContainerInitializer
  </code></pre></li>
  </ul>
  
  <p>How can I debug or affect what's causing above 4s delay? </p>
  
  <hr>
  
  <h3>Configuration</h3>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.company&lt;/groupId&gt;
      &lt;artifactId&gt;application&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;type&gt;war&lt;/type&gt;
  &lt;/dependency&gt;
  
  [...]
  
  &lt;plugin&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;9.4.5.v20170502&lt;/version&gt;
      &lt;configuration&gt;
          &lt;webApp&gt;
              &lt;webInfIncludeJarPattern&gt;empty&lt;/webInfIncludeJarPattern&gt;
              &lt;containerIncludeJarPattern&gt;empty&lt;/containerIncludeJarPattern&gt;
          &lt;/webApp&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" 
       version="3.1" 
       metadata-complete="true"&gt;
  
     &lt;context-param&gt;
         &lt;param-name&gt;contextClass&lt;/param-name&gt;
         &lt;param-value&gt;org.springframework.web.context.support.AnnotationConfigWebApplicationContext&lt;/param-value&gt;
     &lt;/context-param&gt;
  
     &lt;context-param&gt;
         &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
         &lt;param-value&gt;com.app.AnnotationConfig&lt;/param-value&gt;
     &lt;/context-param&gt;
  
     &lt;listener&gt;
         &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
     &lt;/listener&gt;
  
     [...]
  
  &lt;/web-app&gt;
  </code></pre>