编译之后的mapper包中的xml没有编译进来项目结构中target目录下的mapper包中是不是只有mapperclass文件而没有mapperxml文件。应该在pomxml中添加什么配置
要将mapper.xml文件编译进来,可以在pom.xml中添加以下配置:
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
这样配置会将src/main/resources目录下的所有xml文件编译到target目录下的对应位置。确保mapper.xml文件在src/main/resources目录下,并且重新编译项目后,mapper.xml文件应该会在target目录下的mapper包中。
原文地址: http://www.cveoy.top/t/topic/ibDp 著作权归作者所有。请勿转载和采集!