Overriding spring-boot application properties when deploying in JBoss

carpinchosaurio :

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

  • JNDI attributes from java:comp/env.
  • Java System properties (System.getProperties())

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

Simon Martinelli :

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?

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=470323&siteId=1