class path resource [.xml] cannot be opened because it does not exist或者是編譯時mybatis的xml文件沒有生成

問題:class path resource [.xml] cannot be opened because it does not exist或者是編譯時mybatis的xml文件沒有生成

產生原因:idea默認是不編譯 src\main\java下的xml文件的

解決方法:

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

正常編譯後的目錄

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章