问答详情
源自:4-1 自定义sql

Invalid bound statement (not found): com.example.mubatis_plus.mapper.UserMapper.selectAll 问题解决:pom添加

Invalid bound statement (not found): com.example.mubatis_plus.mapper.UserMapper.selectAll

问题解决:pom添加

<build>

        <resources>

            <resource>

                <!--   描述存放资源的目录,该路径相对POM路径-->

                <directory>src/main/java</directory>

                <includes>

                    <include>**/*.xml</include>

                </includes>

            </resource>

        </resources>

        <plugins>

            <plugin>

                <groupId>org.springframework.boot</groupId>

                <artifactId>spring-boot-maven-plugin</artifactId>

            </plugin>

        </plugins>

    </build>


提问者:慕粉1319892 2020-04-23 22:36

个回答

  • 老猿
    2020-04-28 13:26:03

    问题解决了就好。一般是要添加如下配置,不然有的ide不会将写在src/main/java中的xml文件编译或打包到编译后的程序或者包中。

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


  • 稻草人的微笑
    2020-04-24 11:00:59

    按照课堂上的,是配置在application.yml文件中

    mybatis-plus:
      mapper-locations: classpath:mappers/*Mapper.xml