Reading values from application.properties Spring Boot

后端 未结 10 1693
无人及你
无人及你 2021-01-18 10:46

My Spring boot app has this application structure:

  • src
    • main
      • java
      • resources
        • application.properties
      <
10条回答
  •  一整个雨季
    2021-01-18 11:27

    If you are using Spring boot you do not need @PropertySource("classpath:application.properties") if you are using spring boot starter parent , just remove the static keyword and it should start working.

提交回复
热议问题