我在 tomcat 中部署了基于 spring boot 的 war 文件。我无法使用外部应用程序属性文件。我正在使用以下内容来提供外部属性文件的路径
X:\apache-tomcat-7.0.54\bin>startup.bat --Dspring.config.location=X:\conf\application.properties
我也用qoutes试过
X:\apache-tomcat-7.0.54\bin>startup.bat "--Dspring.config.location=X:\conf\application.properties"
这些属性不起作用,spring 正在读取 war 文件中捆绑的属性文件。谁能帮我解决这个问题? 谢谢
最佳答案
尝试
-Dspring.config.location=file:X:/conf/application.properties
如果你需要类路径之外的文件,你必须添加file:
关于spring boot tomcat外部属性文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29741535/