The Jar Scanner Component
Table of Contents
Introduction
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.
Attributes
Common Attributes
All implementations of Jar Scanner support the following attributes:
Attribute | Description |
---|---|
className |
Java class name of the implementation to use. This class must
implement the |
Standard Implementation
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):
Attribute | Description |
---|---|
scanAllDirectories |
If 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 |
scanAllFiles |
If |
scanClassPath |
If |
scanBootstrapClassPath |
If scanClassPath is |
scanManifest |
If |
Nested Components
Only a Jar Scan Filter may be nested inside a Jar Scanner element.
Special Features
No special features are associated with a Jar Scanner element.