SpringBoot工程下mybatis接口类与xml同一目录的配置

一、pom文件增加如下配置

 1         <resources>
 2             <resource>
 3                 <directory>src/main/java</directory><!--所在的目录-->
 4                 <includes><!--包括目录下的.properties,.xml文件都会扫描到-->
 5                     <include>**/*.properties</include>
 6                     <include>**/*.xml</include>
 7                 </includes>
 8                 <filtering>false</filtering>
 9             </resource>
10         </resources>

二、application.properties配置

1 mybatis.mapper-locations=classpath:com/simon/mapper/*.xml
2 mybatis.type-aliases-package=com.simon.entity

 

 

posted @ 2021-12-24 09:00  疯狗强尼  阅读(274)  评论(0编辑  收藏  举报