XLouis

博客园 首页 新随笔 联系 订阅 管理

原因是资源文件没有读取到,在生成的target中没有对应的文件,解决办法:

1、在pom.xml文件中project中添加如下内容:

<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>
</build>

2、将mybatis-config.xml文件中mapper标签中的resource更改为class:

<mappers>
        <mapper class="com.louis.dao.CoordinatorMapper"/>
        <mapper class="com.louis.dao.WorkerMapper"/>
</mappers>

 

posted on 2023-06-09 07:51  XLouis  阅读(94)  评论(1编辑  收藏  举报