idea中Mybatis报Invalid bound statement (not found)错误解决办法

2017-04-20 08:36:00    admin    700    原创

由于idea不再编译source folder下的xml文件,而我们平时使用mybatis时,习惯于将*Mapper.xml文件放在与dao层、service层平级的src目录下。这就导致ItelliJ IDEA不会变异这些xml文件夹,从而导致Invalid bound statement (not found)的发生

在pom.xml中的build下面加入以下代码

<resources>

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


豫ICP备15006410号
蝉知 蝉知4.5.2