1、问题概述?
在使用springboot整么mybatisPlus启动的使用提示信息:
Property 'mapperLocations' was not specified.
但是我确实写了相对应的配置:
【在pom文件中配置xml识别】
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
【在application.yml文件中配置了map-locations】
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
map-underscore-to-camel-case: false
mapper-locations: classpath:/com/*/*/mapper/**.xml
type-aliases-package: com.hazq.hazqoa.bean
2、解决办法
我这个问题其实非常简单,就是配置的缩进写的有问题
正确的配置如下:
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
map-underscore-to-camel-case: false
type-aliases-package: com.hazq.hazqoa.bean
mapper-locations: classpath:/com/*/*/mapper/**.xml
文章讲述了在使用SpringBoot和MyBatisPlus时遇到mapperLocations未指定的问题,原因是配置文件中的缩进问题。作者提供了正确的配置示例,即确保mapper-locations属性没有缩进错误。
12万+

被折叠的 条评论
为什么被折叠?



