1

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?

  • Is it correct to assume you're using Liberty Developer Tools for Eclipse (formerly WebSphere Developer Tools) to deploy the application to the Liberty server? And you're saying that the tooling-generated application config overwrites the custom config you added to server.xml to hook in the shared library? – Scott Kurz Apr 06 '23 at 16:31
  • Correcting myself that "WebSphere Developer Tools" (WDT) is related tooling with overlapping function, rather than a former name for "Liberty Developer Tools". – Scott Kurz Apr 07 '23 at 11:15

1 Answers1

1

(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!

  • Yes, Scott was correct and configuring shared library as suggested on above doumentation link worked perfectly fine. Many Thanks to Matt and Scott. – justanotherdev Apr 07 '23 at 09:16