解决
在pom文件中<builder>标签引入一下 如果还报错将target目录删除 重新run
<resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources>
在application.yml配置文件 默认mapper-locations=classpath:mapper/*.xml 也可以配置自己的mapper路径
因为是默认配置所以注释掉也可以
mybatis-plus:
#mapper-locations: classpath:com/zwf/mapper/*Mapper.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
type-aliases-package: com.zwf.entity
在springboot启动类上加上@MapperScan 指定mapper路径
@SpringBootApplication
@MapperScan("com.zwf.mapper")
public class MydemoApplication {
public static void main(String[] args) {
SpringApplication.run(MydemoApplication.class, args);
}
}