在父类工程pom下<build></build>标签内添加 可以扫描子类dao层的mapper配置文件(必须这样做)
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
如果包含前台文件建议添加一下配置(idea)
<resource>
<directory>src/main/webapp</directory>
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/*.*</include>
</includes>
</resource>
同时可以在spring整合dao层配置文件增加mapper位置 (不是必须的):
<!-- 创建sqlsesion -->
<bean id="SqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="configLocation" value="classpath:SqlMapConfig.xml"></property>
<property name="dataSource" ref="DataSource"></property>
<!-- 指定mapper位置-->
<property name="mapperLocations" value="classpath:com/taotao/mapper/*.xml"></property>
</bean>> 这里输入引用文本