No active profile set, falling back to default profiles: default
Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationProperty': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'application.name' in value "${application.name}"
由于沒有在application.yml中
spring:
profiles: ? ? ??
? ? ? ?active: prod
這樣就解決了這個(gè)問題兔辅。
還有要在pom.xml文件添加如下:
在build這個(gè)目錄下增加如下兩個(gè):
<finalName>springbootdemoproperties</finalName>
<resource>
? ?<resource>
? ? ? ? ? ? ??<directory>src/main/resources
? ? ? ? ? ? ?<filtering>true</filtering>
? ?</resource>
<resource>
不然也會(huì)出現(xiàn)以上這個(gè)錯(cuò)誤前联。