英文:
How to configure external properties folder and libraries in Liberty server 22.0.0.13
问题
以下是翻译好的部分:
我正在使用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服务器上为多个应用程序配置共享属性和库的最佳做法吗?
英文:
I am working with IBM WebSphere Liberty and I have multiple applications that require the same set of properties and libraries. I would like to configure these common properties and libraries at the server level so that they are available to all applications, without having to define/referencing them at the application level.
I tried below configuraton at server level ,but doesn't seems to be working.
<library id="mySharedLib">
<folder dir="/path/to/folder" />
<fileset dir="/path/to/fileset/directory" includes="*.jar" />
</library>
<classLoader commonLibraryRef="mySharedLib" />
However it works fine , if I define commonLibraryRef at application level as below -
<enterPriseApplication id ="app-ear" location="app.ear" name="app-ear">
<classLoader commonLibraryRef="mySharedLib" />
</enterPriseApplication>
The problem with this aproach is, when application is deployed through eclipse then application level configuration get overriden . Can anyone suggest a best practice for configuring common properties and libraries in a Liberty server for multiple applications?
答案1
得分: 1
(Assuming Scott's comment is right) 我认为文档中的这个页面解释了如何在工具中设置项目来使用共享库:
https://www.ibm.com/docs/en/was-liberty/base?topic=library-setting-web-project-use-shared-libraries
它还包含了链接到解释如何使用工具定义共享库的页面。
让我们知道你的进展情况!
英文:
(Assuming Scott's comment is right) I think this page in the documentation explains how to set projects to use shared libraries in the tooling
https://www.ibm.com/docs/en/was-liberty/base?topic=library-setting-web-project-use-shared-libraries
It also contains links to a page explaining how to define shared libraries using the tooling.
Let us know how you get on!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论