Spring boot could not resolve placeholder in string

后端 未结 9 1113
悲哀的现实
悲哀的现实 2020-12-16 14:28

I am running spring-boot on an embedded tomcat server through maven with mvn clean install spring-boot:run. But every time I run it I get this error:

         


        
9条回答
  •  猫巷女王i
    2020-12-16 15:22

    Fixed by adding these lines to the pom under the section

    
         src/main/resources
         true
         
              **/*.properties
         
    
    

    What I don't fully understand is the need for doing this.

    a) I can run this on an external app server without having to add this line and the app reads application.properties just fine.

    b) I can run the app as a standalone java application in eclipse (i.e., without having to build the app through maven) and it reads application.properties just fine

    c) isn't spring-boot supposed to read it by default regardless? (as shown by the two cases above?)

    Thanks everyone for their help. hopefully this will help others.

提交回复
热议问题