How can I turn off annotation scanning of a deployment in JBoss EAP?
Environment
JBoss Enterprise Application Platform (EAP) 5.0.0
Issue
War deployments with large numbers of jars in their WEB-INF/lib directory can take a long time to deploy due to scanning the jars for annotations. How can EAP be configured to avoid such scanning?
Resolution
One can turn off annotation scanning a deployment by adding it to the list of deployments in the definition of the JBossCustomDeployDUFilter in the <jboss-home>/server/<server-dir>/deployers/metadata-deployer-jboss-beans.xml file. For example, to skip annotation scanning for jars within myWar.war, the beginning of the bean definition would look like:
<bean name="JBossCustomDeployDUFilter" class="org.jboss.deployers.vfs.spi.structure.helpers.VirtualFileDeploymentUnitFilter">
<constructor>
<parameter>
<bean class="org.jboss.deployment.FileNameVirtualFileFilter">
<constructor>
<parameter>
<map keyClass="java.lang.String" valueClass="java.util.Set">
<entry>
<key>myWar.war</key>
<value><null/></value>
</entry>
<entry>
<key>jbossweb.sar</key>
<value><null/></value>
</entry>
...
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.