springboot of mapper.xml src next issue

 

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

 

Guess you like

Origin www.cnblogs.com/xiaostudy/p/11228323.html