I have a Spring-Boot based app with YAML based configuration, I have no problem changing the properties when I run with java -jar app.war -Dnamespace.properties=different_value
, but now I have to deploy the application into a JBoss EAP, I succesfully build the war file but I want to modify the properties (override some of the YAML values), without needing to modify the war.
Documentation mentions
As alternatives, but I have no idea how to set up those. Some ideas ?
BONUS: It would be nice to modify the properties in run-time without needing to redeploy the app
To override your Spring Boot application properties when it's running on Kubernetes, just set environment variables on the container. To set an environment variable on a container, first, initialise a ConfigMap containing the environment variables that you want to override.
With this configuration, the application is ready to deploy to any external application server. Once this is done, you can package your Spring Boot application as a war and deploy it to the JBoss server. To do that, you need to run mvn clean package , which will generate the war file.
So in a spring boot application, application. properties file is used to write the application-related property into that file. This file contains the different configuration which is required to run the application in a different environment, and each environment will have a different property defined by it.
You can add system properties in the standalone.xml
<system-properties>
<property name="my.property" value="Hello"/>
</system-properties>
System properties in JBoss EAP can be changed at runtime using CLI or the Webinterface and some other ways.
If your application is reloading it depends on where the properties are used.
What property do you want to override?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With