集成tk-mybatis出错

来源:3-12 创建项目-2

王謀

2019-07-08

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project user-center: Compilation failure: Compilation failure: 
[ERROR] /Users/wanghuajun/Documents/workspace/me-workspace/Muke-SpringCloudAlibaba/user-center/src/main/java/com/itmuch/usercenter/dao/user/UserMapper.java:[4,34] 程序包tk.mybatis.springboot.util不存在
[ERROR] /Users/wanghuajun/Documents/workspace/me-workspace/Muke-SpringCloudAlibaba/user-center/src/main/java/com/itmuch/usercenter/dao/user/UserMapper.java:[6,37] 找不到符号
[ERROR]   符号: 类 MyMapper
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

讲师源码我没有下载,但是我看了配置,我的跟视频中的配置一样,但是,就是始终找不到这个类,我把tk的core包加上,依然找不到这个类,求解,卡死了。。

写回答

1回答

大目

2019-07-08

您好,

  1. 帮忙贴一下UserMapper的代码哈帮忙贴一下

  2. 帮忙贴一下generatorConfig.xml的配置。课上我并没有教大家去通过通用Mapper扩展MyMapper,但从异常来看,您指定了MyMapper,应该是多做了一步。可以看下官方文档:https://github.com/abel533/mapper/wiki/4.1.mappergenerator ,了解一下MyMapper是怎么场景下才会使用。这个接口是需要自己编写,才能配置的,并不是通用Mapper自带的类。

  3. 可以参考我的源码哈:

https://git.imooc.com/coding-358/user-center/src/master/src/main/resources/generator/generatorConfig.xml


祝您学习愉快!


0
4
大目
回复
台风来临的那一夜
不怕不怕,我这种还是个例。
2020-11-25
共4条回复

Spring Cloud Alibaba微服务从入门到进阶

面向未来微服务:熟练掌握Spring Cloud Alibaba

3085 学习 · 1324 问题

查看课程