IDEA中配置文件格式改成springboot的配置文件格式

今天刚从git上拉代码下来,然后一运行项目,一直报错

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aspDnidController': Unsatisfied dependency expressed through field 'aspDnidService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aspDnidServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aspDnidMapper' defined in file [E:\code\LRIT\lrit\common\target\classes\cn\ctticsh\lrit\common\mapper\basedata\AspDnidMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

但奇怪的是,其他同事拉下来运行都是好好的,没有报错....就我这边一启动项目之后报错了,,简直有毒,,上网查了一下,,没找到解决方法,,然后我觉得不科学,怎么可能同事运行没错,就我运行有问题,

【解决之路】

然后我就仔细看了一下,终于发现有点问题了,这边项目默认用IDEA打开的时候application.yml长这个样子,看着就不太对劲,

IDEA中配置文件格式改成springboot的配置文件格式

一般正常的springboot项目的配置文件应该是长这个样子的

IDEA中配置文件格式改成springboot的配置文件格式

然后我就改下配置,右键项目----->Open Moudel Setting

IDEA中配置文件格式改成springboot的配置文件格式

默认是这个Sources,

IDEA中配置文件格式改成springboot的配置文件格式

这边需要改成Resources,然后保存

IDEA中配置文件格式改成springboot的配置文件格式

可以看到这边已经变成正常的配置文件格式,然后启动项目就正常了,没有报错了

IDEA中配置文件格式改成springboot的配置文件格式