如果mapper沒有在resource目錄下需要在pom文件build標簽中添加以下代碼
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.class</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
該配置和配置文件中的(mapper-locations: classpath*:/com/mybatis/**/*Mapper.xml)必須同時存在
mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl mapper-locations: classpath*:/com/mybatis/**/*Mapper.xml
如果沒有掃描到yml注意啟動項目時打印的 ”Property 'mapperLocations' was not specified.”

