Jetty Annotation Timeout Reason

The most simple way is adding the system property in pom.xml

https://www.eclipse.org/jetty/documentation/9.4.x/jetty-maven-plugin.html#setting-system-properties


I've got the same error and to fix it, you should add to your start script (start.ini) the following:

-Dorg.eclipse.jetty.annotations.maxWait=120

120 is for two minutes of annotation scanning in case that you need a higher value, just set it to the propper one.


One more (in my opinion) convinient way is to set this property using a jetty.xml like so:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure>
    <Call name="setProperty" class="java.lang.System">
        <Arg>org.eclipse.jetty.annotations.maxWait</Arg>
        <Arg>120</Arg>
    </Call>
</Configure>

This way you can omit the commandline args


It is useless to scan all dependent jars, you can make the scanning pattern more restrictive to only match certain jars:

<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <version>9.2.8.v20150217</version>
  <configuration>
    <webAppConfig>
      <contextPath>/</contextPath>
      <webInfIncludeJarPattern>.*/foo-[^/]*\.jar$|.*/classes/.*</webInfIncludeJarPattern>
    </webAppConfig>
  </configuration>
</plugin>

See webInfIncludeJarPattern doc for more details: http://www.eclipse.org/jetty/documentation/9.4.x/jetty-maven-plugin.html#configuring-your-webapp