In pom.xml inside the build tag plus resources Description
< Resources > <-! Mapper.xml java files in the directory -> < Resource > < Directory > src / main / java </ Directory > < Includes > < the include > . ** / * xml </ the include > < / Includes > </ Resource > <-! mapper.xml file in the resources directory -> < Resource > < directory > src / main / resources </ directory > </resource> </resources>
Then declare mapper.xml specific location in application.yml
mybatis:
mapper-locations: classpath:com/xiaostudy/test/mapper/xml/*.xml