文件结构是这个样子,mapper.xml文件在resources/mappers/fdms目录下面
通常来说, 将mapper打包到target目录下只需要在maven下面配置
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>com.dtcloud.soe/*</include>
<include>**/*.xlsx</include>
<include>*.xml</include>
<include>*.yml</include>
<include>*.json</include>
<include>*.properties</include>
<include>*.conf</include>
<include>mappers/fdms/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources/${profiles.active}</directory>
<filtering>false</filtering>
</resource>
</resources>
就行了,但是我配置好了还是不行,经过仔细检查之后发现 , 原来我的目录结构错了, 我的是这样子的
但是在idea中完全看不出来,
这个问题有时候非常难以发现, 必须要打开文件结构才能发现, 是一个很隐秘的坑