如果mapper没有在resource目录下需要在pom文件build标签中添加以下代码

<resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.class</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>

该配置和配置文件中的(mapper-locations: classpath*:/com/mybatis/**/*Mapper.xml)必须同时存在

mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  mapper-locations: classpath*:/com/mybatis/**/*Mapper.xml

如果没有扫描到yml注意启动项目时打印的 ”Property 'mapperLocations' was not specified.”

springBoot整合mybatis配置mapper xml问题

相关文章:

  • 2021-06-17
  • 2022-12-23
  • 2021-08-24
  • 2022-01-26
  • 2021-06-06
  • 2021-09-02
  • 2021-07-27
  • 2019-11-12
猜你喜欢
  • 2021-10-16
  • 2022-12-23
  • 2021-09-06
  • 2021-10-21
  • 2021-07-29
  • 2021-07-07
  • 2022-01-06
相关资源
相似解决方案