IDEA中的Springboot配置文件不被使用,配置显示灰色
1.启动Springboot项目,出现‘url’ attribute is not specified and no embedded datasource could be configured.
具体错误信息详见下图所示:配置显示灰色,不能获取到配置连接。
2.原因是resources没有没有被标志为Resources Root
,标记的具体步骤为:选中reources文件右键-->Mark Directory as-->Resources Root
。详情信息如下图所示。
3.完成上述步骤后,如图所示。可以正常运行,配置文件不显示为灰色。