Shared libraries
Shared libraries are files used by multiple applications. You can use shared libraries and global libraries to reduce the number of duplicate library files on your system. When properly configured, applications and resource adapters may access classes and resources of libraries, but the opposite is not true, libraries have no access to application or resource adapter classes or resources.
Global libraries
Global libraries can be used by any application. JAR files are placed in a global library directory, and then are specified in the class loader configuration for each application.
You can place global libraries in two locations:
- ${shared.config.dir}/lib/global
- ${server.config.dir}/lib/global
<classloader>
element configured, the application
uses these libraries. If a class loader configuration is present, these libraries are not used
unless the global library is explicitly referenced.For more information, see Providing global libraries for all Java™ EE applications.
Resource files
Within Liberty libraries, you can have
resource files defined in the library element. For example,
<library>
<folder dir="..." />
<file name="..." />
<fileset dir="..." includes="*.jar" scanInterval="5s" />
<folder dir="${server.config.dir}/mylibs" />
<file name="${server.config.dir}/otherlibs/my.jar" />
</library>
The folder setting in the example, allows all files under the
mylibs directory to be available on the classpath. You can use this style of
entry to have your .xml and .properties available.