Springboot not loading application.dev.properties file

前端 未结 4 2205
-上瘾入骨i
-上瘾入骨i 2021-02-19 18:27

In my project I want to use environment specific property file. For example if I am running it into development it should use application.dev.properties, for production it shoul

4条回答
  •  别跟我提以往
    2021-02-19 19:13

    A few issues I noticed:

    1. @Value property name should be a String like @Value("${server.database.host}")
    2. Profile specific property files should follow application-{profile}.properties format, e.g. application-dev.properties
    3. Try passing the profile with -D like java -Dspring.profiles.active=dev -jar app.jar

提交回复
热议问题