org.apache.ibatis.binding.bindingexception: invalid bound statement (not found: com.xx..mapper.xxMap


dao层编译后只有class文件,没有mapper.xml,因为maven工程在默认情况下src/main/java目录下的所有资源文件是不发布到target目录下的

我的mapper.xml不在resource下面

1.pom.xml:在依赖下面添加




src/main/java

com/xiu/record/**/mapper/*.xml

false


2.application加上:
mapper-locations: classpath:com/xiu/record/**/mapper/*.xml
mybatis:
# configuration:
# map-underscore-to-camel-case: true #开启驼峰命名
mapper-locations: classpath:com/xiu/record/**/mapper/*.xml
# type-aliases-package: com.xiu.record.customer.model;
config-location: classpath:/mybatis/mybatis-config.xml


相关