配置外部属性文件和Liberty服务器22.0.0.13中的库。

huangapple go评论58阅读模式
英文:

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.

&lt;library id=&quot;mySharedLib&quot;&gt;
    &lt;folder dir=&quot;/path/to/folder&quot; /&gt;
    &lt;fileset dir=&quot;/path/to/fileset/directory&quot; includes=&quot;*.jar&quot; /&gt;
&lt;/library&gt;

&lt;classLoader commonLibraryRef=&quot;mySharedLib&quot; /&gt;

However it works fine , if I define commonLibraryRef at application level as below -

&lt;enterPriseApplication id =&quot;app-ear&quot; location=&quot;app.ear&quot; name=&quot;app-ear&quot;&gt;
&lt;classLoader commonLibraryRef=&quot;mySharedLib&quot; /&gt;
&lt;/enterPriseApplication&gt;

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!

huangapple
  • 本文由 发表于 2023年4月6日 23:35:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951297.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定