0
我试图让我的弹簧引导项目使用在项目外定义的属性。我已经尝试了文档中描述的步骤,但我无法使其工作。外部属性弹簧启动
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
.
+- folder
+- properties
+- application.properties
+- myproject
+- src
我用这对VM选项:-Dspring.config.location=file:../properties/
但它不工作。我尝试了多个值为spring.config.location
没有成功(我想这个问题是从这里)。
#1。尝试使用虚拟机选项上的全限定路径,例如:'-Dspring.config.location = file:/ app/config/properties /'。 #2。尝试使用'--'选项而不是VM选项,例如:'java -jar myproject.jar --spring.config.location = file:../ properties /' – Rafa