springboot整合mybatis錯誤 Invalid bound statement (not found): com.yuan.mapper.UserMapper.getUserList


出現的原因是 

src文件下的mapper有mapper接口和映射文件,而target下的mapper文件卻沒有映射文件

      

 

===========================解決方案==================================

 1.把映射文件 放到resources 目錄下 結構目錄一模一樣

 2.在pom.xml中導入以下代碼

<build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM