How to load external property file in Spring Boot in Wildfly
I wonder how I can load the external property of my application running inside Wildfly 9 as a WAR, I tried to add a java parameter to execute Wildfly but the application doesn't seem to recognize the properties.
-Dspring.config.location=file:///C:\Temp\config\application.properties,classpath:application.properties
Is there a way how Spring Boot could read an external properties file? I am trying to download and run a Spring Boot application as a WAR inside Wildfly.
Any help would be appreciated.
Thank.
+3
source to share
1 answer
On my Linux system, I have an entry in standalone.xml :
<system-properties>
<property name="spring.config.location" value="file:/opt/jboss/wildfly/standalone/configuration/"/>
</system-properties>
I just defined a directory here, so it must end with "/".
My application.yml is in the "/ opt / jboss / wildfly / standalone / configuration /" directory.
+2
source to share