I am trying to serve a static file on OpenLiberty application but haven't found a straightforward way to do so.
At first I simply put the file in the src/resources and webapp/META-INF folder but it seems that this is not enough.After a bit of research I found a few approaches which all didn't fit my needs.
For instances [0] suggested placing the file in the dropin folder. But this is a folder in the deployed app and I need the file within the source root folder at build time. Another post [1] suggested created a custom config file but that is for WAS only. When I started to look more broadly (JaxRS) there was even the idea to create Rest endpoint that loads the file from the classpath [2]. This idea, while being plausible, seems to complicated for what I intend to accomplish. I even found a config option (fileServingEnabled) in the official documentation [3] but the description is thin on how to properly configure it.
Is it possible to do that with plain OpenLiberty or do I have to go another way in order to achieve that?
[0] How do I display an HTML file using Websphere Liberty?
[2] How to serve static content with JAX-RS?
[3] https://openliberty.io/docs/21.0.0.9/reference/config/webContainer.html