I have a spring-boot webapp.war which was developed and deployed to tomcat 8.5, which is configured using a tomcat context file like so:
<?xml version="1.0" encoding="UTF-8"?> <Context> <Parameter name="spring.config.additional-location" value="/path/to/additional-location-application.yml" /> </Context>
I’d like to deploy this on an existing websphere 8.5 server, however I am having trouble understanding how I can provide this optional context parameter to the application.
There is a similar question here: https://stackoverflow.com/questions/19968783/how-to-define-context-parameters-in-the-websphere-config-instead-of-the-web-xml
However ideally, I don’t want to modify the original web.xml in the war file. It’s also possible to provide this parameter in the JVM options like
-Dspring.config.additional-location=/path/to/additional-location-application.yml however the problem with doing it that way, is that it would affect all the spring boot applications deployed on the same server
Suggestion to use environment parameters instead: