mybatis:
mapper-locations: classpath:**/*.xml #这个可以使用
#mapper-locations: classpath:mappeer/*.xml #这个不行
#datasource
spring:
datasource:
url: jdbc:mysql://localhost:3306/javaee?serverTimezone=UTC
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
##mybatis配置
mybatis:
mapper-locations: classpath:**/*.xml
#mapper映射文件
type-aliases-package: com.example.pojo
#设置别名
src/main/resources/mapper/UserMapper.xml
mybatis.mapper-locations= classpath:mapper/*.xml 如何和这样配置也是可以
mapper-locations: classpath*:m*/*.xml
这个**/*.xml好像不能用 前面必须得有字母
# mapper-locations: classpath:mapper/*.xml
这个也可以,由于没有指定namespace(没注意看)