我正在使用 IBM WebSphere Liberty,我有多个应用程序需要同一组属性和库。我想在服务器级别配置这些公共属性和库,以便它们可供所有应用程序使用,而不必在应用程序级别定义/引用它们。 我在服务器级别尝试了以下配置,但似乎没有用。
<library id="mySharedLib">
<folder dir="/path/to/folder" />
<fileset dir="/path/to/fileset/directory" includes="*.jar" />
</library>
<classLoader commonLibraryRef="mySharedLib" />
但是它工作正常,如果我在应用程序级别定义 commonLibraryRef 如下 -
<enterPriseApplication id ="app-ear" location="app.ear" name="app-ear">
<classLoader commonLibraryRef="mySharedLib" />
</enterPriseApplication>
这种方法的问题是,当通过 eclipse 部署应用程序时,应用程序级别的配置会被覆盖。谁能建议在 Liberty 服务器中为多个应用程序配置公共属性和库的最佳实践?