springboot 配置多个mapper-locations

mybatis-plus:
  typeAliasesPackage: com.ruoyi
#  mapper-locations: classpath:mybatis/**/*Mapper.xml
#  mapper-locations: [classpath:mybatis/**/*Mapper.xml,classpath:com/ruoyi/**/*Mapper.xml]
  mapper-locations:
    - classpath:mybatis/**/*Mapper.xml
    - classpath:com/ruoyi/**/*Mapper.xml

xml里

<build>
		<finalName>${project.artifactId}</finalName>
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<includes>
					<include>**/*.xml</include>  //需要加这一段
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
				</configuration>
			</plugin>
		</plugins>
	</build>
经验分享 程序员 微信小程序 职场和发展