mybatis-generator , failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver 解决方案

mybatis整合generator自动生成代码,配置好generatorConfig.xml文件后,执行 mybatis-generator:generate 命令报异常

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-mybatis-demo: Execution default-cli of goal org.mybatis.generator:
mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver -> [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/PluginExecutionException

failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver

第一反应是看pom文件中有没有引用mysql链接jar包


    mysql
    mysql-connector-java
    5.1.38

但是不幸的是自己配置了,一头雾水

mybatis-generator , failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver 解决方案_第1张图片

网上求教高手指点,发现自己正是应用了分页插件

mybatis-generator , failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver 解决方案_第2张图片

在generator配置里再次加上mysql-connector-java 完美解决

 
            
                org.mybatis.generator
                mybatis-generator-maven-plugin
                1.3.2
                
                    
                        mysql
                        mysql-connector-java
                        5.1.38
                    
                
                
                    ${basedir}/src/main/resources/generator/generatorConfig.xml
                    true
                    true
                
            

 

关注回复【资料】,免费获取架构资料、视频,还有精心整理的面试题

mybatis-generator , failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver 解决方案_第3张图片
 

你可能感兴趣的:(maven)