The Jar Scanner element represents the component that is used to scan the web application for JAR files and directories of class files. It is typically used during web application start to identify configuration files such as TLDs or web-fragment.xml files that must be processed as part of the web application initialisation.
A Jar Scanner element MAY be nested inside a Context component.
For example you can include the bootstrap classpath when scanning for jar files:
<Context> ... <JarScanner scanBootstrapClassPath="true"/> ... </Context>
If a Jar Scanner element is not included, a default Jar Scanner configuration will be created automatically, which is sufficient for most requirements.
All implementations of Jar Scanner support the following attributes:
Java class name of the implementation to use. This class must
If not specified, the standard value (defined below) will be used.
The standard implementation of Jar Scanner is org.apache.tomcat.util.scan.StandardJarScanner. It supports the following additional attributes (in addition to the common attributes listed above):
true, any directories found on the classpath will be
checked to see if they are expanded JAR files.
The default is
Tomcat determines if a directory is an expanded JAR file by looking
for a META-INF sub-directory. Only if the META-INF sub-directory exists,
the directory is assumed to be an expanded JAR file. Note that for scans
for matches to
@HandlesTypes annotations, all directories
will be scanned irrespective of the presence or not of a META-INF
true, any files found on the classpath will be checked
to see if they are Jar files rather than relying on the file extension
.jar. The default is
true, the full web application classpath, including
the shared and common classloaders and the system classpath (but not the
bootstrap classpath) will be scanned for Jar files in addition to the web
application. The default is
If scanClassPath is
true and this is
true the bootstrap classpath will also be scanned for Jar
files. The default is
true, the Manifest files of any JARs found will be
scanned for additional class path entries and those entries will be added
to the URLs to scan. The default is
Only a Jar Scan Filter may be nested inside a Jar Scanner element.
No special features are associated with a Jar Scanner element.