集成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回答
-
您好,
帮忙贴一下UserMapper的代码哈帮忙贴一下
帮忙贴一下generatorConfig.xml的配置。课上我并没有教大家去通过通用Mapper扩展MyMapper,但从异常来看,您指定了MyMapper,应该是多做了一步。可以看下官方文档:https://github.com/abel533/mapper/wiki/4.1.mappergenerator ,了解一下MyMapper是怎么场景下才会使用。这个接口是需要自己编写,才能配置的,并不是通用Mapper自带的类。
可以参考我的源码哈:
祝您学习愉快!
042020-11-25
相似问题