I have a simple Spring/Gradle/Liberty REST service that I would like to deploy on several different servers, with each deployment having different resources (e.g., connection parameters). Is there some way to keep the resource folder(s) separately from the .war, so that I can build and deploy the same .war to all deployments and only supply somehow the per-deployment resource folders?
Asked
Active
Viewed 46 times
0
-
are these resources just configuration-type things? If so, environment variables sound like a good option. If not, you'll have to give more examples of the resources you are referring to – Andy Guibert May 07 '18 at 21:31
-
Resources include: XML file with bean definitions, properties file, .yml file used for OAuth2, and some logger setting files. – Mark Lavin May 07 '18 at 23:16
-
Assuming the resources are loaded through getResource() calls, a shared library might be the way to go - you can add a directory entry to a shared library class path and associate that library with whatever apps need access to that location. – Jarid May 08 '18 at 03:03
-
The resources are loaded by Spring. – Mark Lavin May 08 '18 at 12:55
-
Where do you put them when they're in the WAR itself? I'd assume Spring uses getResource(), but I don't know that for sure. – Jarid May 08 '18 at 15:48