项目maven打包时报错Mapped Statements collection does not contain value for的解决方法

这篇文章主要讲解了“项目maven打包时报错Mapped Statements collection does not contain value for的解决方法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“项目maven打包时报错Mapped Statements collection does not contain value for的解决方法”吧!

此问题的发生有可能为项目maven打包时没有将java目录下的mapper.xml文件添加进去,常发生在打war包的tomcat项目中。可以在pom文件中添加以下内容来解决问题:

<build>  
    <finalName>test</finalName>  
    <!--  
    这样也可以把所有的xml文件,打包到相应位置。  
    <resources>  
        <resource>  
            <directory>src/main/resources</directory>  
            <includes>  
                <include>**/*.properties</include>  
                <include>**/*.xml</include>  
                <include>**/*.tld</include>  
            </includes>  
            <filtering>false</filtering>  
        </resource>  
        <resource>  
            <directory>src/main/java</directory>  
            <includes>  
                <include>**/*.properties</include>  
                <include>**/*.xml</include>  
                <include>**/*.tld</include>  
            </includes>  
            <filtering>false</filtering>  
        </resource>  
    </resources>  
</build>

感谢各位的阅读,以上就是“项目maven打包时报错Mapped Statements collection does not contain value for的解决方法”的内容了,经过本文的学习后,相信大家对项目maven打包时报错Mapped Statements collection does not contain value for的解决方法这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!