在今天,无意中看到了这样的错误

出现了这样的异常

也就是未能识别@profile.active@
但是pom.xml文件中确实配置了

解决方法就是在pom.xml文件使用spring-boot官方parent
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath />
</parent>
原因就是如果继承父类,它有配置了资源目录,也即是可以手动配置资源目录
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>


