简体   繁体   中英

spring boot tomcat external properties file

I have spring boot based war file deployed in tomcat. I am not able to use external application properties file. I am using following to provide the path of external properties file

X:\apache-tomcat-7.0.54\bin>startup.bat --Dspring.config.location=X:\conf\application.properties

I have also tried it with qoutes

X:\apache-tomcat-7.0.54\bin>startup.bat "--Dspring.config.location=X:\conf\application.properties"

These properties are not working and spring is reading properties file that are bundled inside the war file. Can anyone please help me with this? Thanks

Try

-Dspring.config.location=file:X:/conf/application.properties

You have to add file: if you need a file outside of classpath

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM