mybatis_Generator 使用maven 构建遇到的问题

!由于本帖主要用来记录异常,有关mybatis genertor 的使用方法暂不做介绍

1.this is not a Mybatis Generator Configuration File


    使用maven plugin mybatis-generator-maven-plugin 来启动并构建generatorConfig.xml中配置的一些model、dao、xml 时已经将此项目先install,后运行插件 代码:mvn: mybatis-generator:generate 时出现上述问题。

    解决方案:这里的提示是指 插件中configuration file 标签加载 generatorConfig.xml 信息时错误导致的,经过查看generatorConfig.xml 发现xml中的dtd约束书写错误导致异常。

2. Exception getting JDBC Driver




      基于上图配置中的信息所示,plugin中并没有添加mysql-connector-java 的依赖导致找不到jdbc的Driver.

解决方案:

        在plugin中添加对应的依赖,由于记得添加本项目的依赖,这样做的好处就是当自己定制了MBG(mybatis genertor)的某个实现时,插件可以根据依赖找到文件。



猜你喜欢

转载自blog.csdn.net/qq_37151646/article/details/81008494
今日推荐