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>

猜你喜欢

转载自blog.csdn.net/qq_29072049/article/details/88165102