Spring Boot忽略IntellijIdea中的application.properties文件

问题描述

从存储库克隆spring-boot应用程序后,它无法启动并出现错误

“无法配置数据源:未指定'url'属性,并且无法配置任何嵌入式数据源。“

我的application.properties文件

server.port=1598
spring.datasource.url=jdbc:postgresql://localhost/Server
spring.datasource.username=admin
spring.datasource.password=admin

当我删除文件时-没有任何变化。

解决方法

解决方案是将目录“ resources”标记为Idea中的“资源根”。enter image description here